At the moment, I am working in a project in which we use a grid with a dhtmlxtoolbar for pagination.
I need to modify the order of the components (buttons, combos and so on) of the pagination toolbar: par example, we’d like to place the previous/next buttons together on the right, etc.
I have looked for it in dhtmlx documentation, api, etc but I have found any code example. I don’t know if it is possible, and if it is, how can it be done.
How would I customize the pagination toolbar to do the following?
[]Show total number of items returned in query[/]
[]Customize the Rows Per Page dropdown to show only 5, 10, 25, 100, or All[/]
I figured out the answer to my first question, “How do I Customize the Rows Per Page dropdown to show only 5, 10, 25, 100, or All?”
First I need to remove the default items I do not want:
labgrid.loadXML("./connectors/label_connector.php",function(){
var toolbar = labgrid.aToolBar;
toolbar.removeListOption("perpagenum","perpagenum_15");
toolbar.removeListOption("perpagenum","perpagenum_20");
toolbar.removeListOption("perpagenum","perpagenum_30");
Then I need to add the two options that were missing:
toolbar.addListOption("perpagenum","perpagenum_100",4,"button","100 rows per page");
toolbar.addListOption("perpagenum","show_all",0,"button","Show All");
Finally I add the function to handle the “Show All” option:
toolbar.attachEvent("onClick",function(val){
if (val=="show_all"){
labgrid.rowsBufferOutSize=99999999999999999999999999999;
labgrid.changePage();
toolbar.setItemText("perpagenum","Show All");
}
});
});
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan