Currently, I am collaborating on a project involving the utilization of ext.net, where a paginator is located within the toolbar of an HtmlEditor.
The markup is as follows:
<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>
Here is the toolbar render function:
function ButtonRender(he){
he.getToolbar().add([{xtype:'tbseparator'}]);
he.getToolbar().addButton([{
id:'previousBtn',
iconCls:'arrow-left',
handler: function(){previousPageClick();},
scope: this,
tooltip: 'Previous Page',
overflowText: 'Previous Page'
}]);
he.getToolbar().addField( [{
id:'pageCounter',
xtype : 'tbtext',
text : '1 of 3',
width: '40'
}]);
he.getToolbar().addButton([{
id:'nextBtn',
iconCls:'arrow-right',
handler: function(){nextPageClick();},
scope: this,
tooltip: 'Next Page',
overflowText: 'Next Page'
}]);
he.getToolbar().add([{xtype:'tbseparator'}]);
he.getToolbar().addButton([{
iconCls:'icon-printer-color',
handler: function(){pdfClick();},
scope: this,
tooltip: 'Print',
overflowText: 'Print'
}]);
Overall, everything is functioning properly: Buttons are being added, page changes are working smoothly, etc. However, the issue arises with the "pageCounter" textfield in the toolbar displaying "1 of 3" when it could be "1 of 2." Is there a way to dynamically change this value based on specific conditions?
To clarify further: I require that upon loading the page, the textfield exhibits different numbers depending on the total number of pages.