jquery Learning Note--jqgrid related how-to list (top)

Source: Internet
Author: User
Tags jqgrid

1. Get the current list of rows: $ ("#gridid"). Getgridparam ("RecCount");

2. Get the selected row data (JSON): $ ("#gridid"). Jqgrid (' getRowData ', id);

3. Refresh the list: $ (refreshselector). Jqgrid (' Setgridparam ', {url: '), PostData: '}). Trigger (' Reloadgrid ');

4. Select the line: $ ("#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's not.)//true: Reload tabular data, false: do not re- Loading Tabular data

5. Reset the selected line: $ ("#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 particular cell and can set class or style properties. Where:

rowidthe ID of the row,
Colnamethe Name of the column (this parameter can is a number (the index of the column) beginning from 0
Datathe content that can is put into the cell. If empty string The content won't be changed
Classif class is string and 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, the value is empty

8. Get the selected Row ID

var rowID = $ ("#jqgrid"). Jqgrid (' Getgridparam ', ' selrow ');

var rowID = $ ("#searchResultList"). Getgridparam ("Selrow");
var RowData = $ ("#searchResultList"). GetRowData (ROWID); /based on row ID, gets the data of the selected row (based on)

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.