Jqgrid-related operation memo

Source: Internet
Author: User
Tags jqgrid

1. Get the number of rows in the current list: $ ("# gridid"). getgridparam ("reccount ");

2. Get the data of the selected row (JSON): $ ("# gridid"). jqgrid ('getrowdata', ID );

3. Refresh the list: $ (refreshselector). jqgrid ('setgridparam', {URL: ''), postdata:''}). Trigger ('reloadgrid ');

4. Select the row: $ ("# jqgrid"). setselection ("1", true); (Toggles a selection of the row with ID =Rowid; IfOnselectrowIs true (the default) then the event onselectrow is launched, otherwise it is not.) // true: Reload table data, false: Do not reload table data

5. Reset the selected row: $ ("# jqgrid"). resetselection (); // resets (unselects) the selected row (s). Also works in multiselect mode.

6. clear: $ ("# jqgrid "). cleargriddata (); // clears the currently loaded data from grid. if the clearfooter parameter is set to true, the method clears the data placed on the footer row.

7. $ ("# jqgrid"). setcell (rowid, colname, ndata, CSSP, attrp );

// This method can change the content of Particle Cell and can set class or style properties. where:

RowidThe ID of the row,
ColnameThe name of the column (this parameter can be a number (the index of the column) beginning from 0
DataThe content that can be put into the cell. If empty string the content will not be changed
ClassIf class is string then we add a class to the cell using addclass; if class is an array we set the new CSS properties via CSS
PropertiesSets the attribute properies of the cell,

ForceupIf the parameter is set to true we perform update of the cell instead that the value is empty


8. Obtain the selected row ID var rowid = $ ("# jqgrid"). jqgrid ('getgridparam', 'selrow ');

To be continued...

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.