How to implement in grid loading in Dhtmlxgrid

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.