Home  >  Article  >  Web Front-end  >  Summary of methods for selecting row data in Grid_javascript skills

Summary of methods for selecting row data in Grid_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:11:381953browse
Copy code The code is as follows:

grid.getStore().getRange(0,store.getCount() ;
grid.getSelectionModel().getSelections(); //Get all selected rows
//Note: If you do not declare var sm = new Ext.grid.CheckboxSelectionModel();, this sentence will be reported. The object or property
Var selectRows = grid.getSelectionModel().getSelections();
selectRows[0].get("dataIndex attribute value of a column in gird") //Get a column of the selected row record The value of
Copy the code


The code is as follows:

grid .selModel.selections.items; //Get all rows selected

Copy code
The code is as follows :

grid.getSelectionModel().getSelected(); //Get the first row of the selected row

Copy code
The code is as follows:

// Get the data of a row in the grid when you click on it
proLevelGrid.on('rowclick' , function(proLevelGrid,rowIndex,event){
var record = proLevelGrid.getStore().getAt(rowIndex);
addProductLevel_form.getForm().loadRecord(record); alert(record.get( 'id')); });


Copy code


The code is as follows:

var grid1_RowClick = function(a,b,c){
// Get the data of a specific column
var id = a.getStore().getAt(b) .get("Id");
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn