How do I implement the focus on the last line after the grid load is Dhtmlxgrid? Recently, a netizen wrote to ask this question, the evening looked at the document, found that you can use the following methods: First, from the document can be learned that in the Loadxml method, in fact, there is a second parameter, Aftercall, It means that the Aftercall method can be invoked after the grid load has completed.
As for how to move the focus to the last line, you can use the Selectcell method to achieve, the specific instructions please see the documentation, I do not say in detail here, just to mention, using the Getrowsnum method to obtain the total number of grid line.
Here's a look at the specific code:
JS Code
Defining Tolastrow Functions
function Tolastrow ()
{
Mygrid.selectcell (Mygrid.rowscol[mygrid.getrowsnum () -1],0,true);
}
Mygrid = new Dhtmlxgridobject (' Gridbox ');
Mygrid.setimagepath (".. /imgs/");
Mygrid.setheader ("Author,title");
Mygrid.setinitwidths ("150,150")
Mygrid.setcolalign ("Left,left")
Mygrid.setcoltypes ("Ro,link");
Mygrid.setcolsorting ("Str,str")
Mygrid.setcolumncolor ("White, #d5f1ff")
Mygrid.init ();
Mygrid.loadxml ("Grid_links.xml", Tolastrow); When grid loading is complete, call Tolastrow
Dhtmlxgrid is a powerful, scalable web development of the client grid frame, if again with Ajax, it can greatly improve the operability of software clients, I am currently studying Dhtmlxgrid, The introduction of Dhtmlxgrid into our project, of course, Dhtmlxgrid still have some problems, such as the choice of dates (a previous article I have given the solution), the definition of the formula, the result of rounding up the problem, and so on, which requires familiarity with its code, Improved and revised on this basis.