How to dynamically change text of textfield inside toolbar in Ext.net

DavidM

New Member
I'm working on a project with ext.net which has a paginator inside the toolbar of an HtmlEditor Markup is:\[code\]<ext:Hidden ID='HF_type' runat="server"/> <ext:HtmlEditor ID="HtmlEditor1" runat="server" Height="800" Width="1050" EnableAlignments="false" EnableColors="false" EnableFont="false" EnableFontSize="true" EnableLinks="false" EnableLists="false" EnableSourceEdit="false" Maximizable="false" > <Listeners> <Initialize Handler="ButtonInit(#{HtmlEditor1})" /> <Render Handler="ButtonRender(#{HtmlEditor1})" /> </Listeners> </ext:HtmlEditor>\[/code\]Toolbar render function:\[code\]function ButtonRender(he){he.getToolbar().add([{xtype:'tbseparator'}]);he.getToolbar().addButton([{ id:'previousBtn', iconCls:'arrow-left', handler: function(){previousPageClick();}, scope: this, tooltip: 'Pagina precedente', overflowText: 'Pagina precedente'}]);he.getToolbar().addField( [{ id:'pageCounter', xtype : 'tbtext', text : '1 di 3', width: '40'}]);he.getToolbar().addButton([{ id:'nextBtn', iconCls:'arrow-right', handler: function(){nextPageClick();}, scope: this, tooltip: 'Pagina successiva', overflowText: 'Pagina successiva'}]);he.getToolbar().add([{xtype:'tbseparator'}]);he.getToolbar().addButton([{ iconCls:'icon-printer-color', handler: function(){pdfClick();}, scope: this, tooltip: 'Stampa', overflowText: 'Stampa'}]);\[/code\]Everything is working fine: Buttons are added, page changes work etc. The only problem that i have is that in the "pageCounter" textfield of the toolbar the text is "1 di 3" but it could also be "1 di 2". How can i change this value depending on certain conditions?To explain better: I need that on page load the textfield appears with different number depending on number of pages.
 
Back
Top