Home > Web Front-end > JS Tutorial > body text

Grid得到选择行数据的方法总结_javascript技巧

WBOY
Release: 2016-05-16 18:11:38
Original
1897 people have browsed it
复制代码 代码如下:

grid.getStore().getRange(0,store.getCount()); //得到grid所有的行


复制代码 代码如下:

grid.getSelectionModel().getSelections(); //得到选择所有行
//注:如果不声明var sm = new Ext.grid.CheckboxSelectionModel();则会报此句没有该对象或属性
Var selectRows = grid.getSelectionModel().getSelections();
selectRows[0].get(“gird中某列的dataIndex属性值”) //取选中行记录的某列的值


复制代码 代码如下:

grid.selModel.selections.items; //得到选择所有行


复制代码 代码如下:

grid.getSelectionModel().getSelected(); //得到选择行的第一行


复制代码 代码如下:

// 单击gird中某一行时取得该行的数据
proLevelGrid.on('rowclick', function(proLevelGrid,rowIndex,event){
var record = proLevelGrid.getStore().getAt(rowIndex);
addProductLevel_form.getForm().loadRecord(record);
alert(record.get('id'));
});


复制代码 代码如下:

var grid1_RowClick = function(a,b,c){
// 获取列某一特定列的数据
var id = a.getStore().getAt(b).get("Id");
}
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!