The method of selecting row data in grid summarizes _javascript skills

Source: Internet
Author: User
Copy Code code as follows:

Grid.getstore (). GetRange (0,store.getcount ()); Get all the lines in grid


Copy Code code as follows:

Grid.getselectionmodel (). Getselections (); Get All rows selected
Note: If you do not declare var sm = new Ext.grid.CheckboxSelectionModel (), the sentence does not have the object or property
Var selectrows = Grid.getselectionmodel (). Getselections ();
Selectrows[0].get ("Dataindex property value for a column in Gird")//The value of a column with a selected row record


Copy Code code as follows:

Grid.selModel.selections.items; Get All rows selected


Copy Code code as follows:

Grid.getselectionmodel (). getselected (); Get the first line of the selection line


Copy Code code as follows:

When you click a row in Gird to get the data for that row
Prolevelgrid.on (' Rowclick ', function (prolevelgrid,rowindex,event) {
var record = Prolevelgrid.getstore (). GetAt (RowIndex);
Addproductlevel_form.getform (). Loadrecord (record);
Alert (record.get (' id '));
});


Copy Code code as follows:

var Grid1_rowclick = function (a,b,c) {
Get data for a particular column in a column
var id = a.getstore (). GetAt (b). Get ("id");
}

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.