请问EXTJS中怎么通过Store获取相应字段的值?
问题描述:
test_yearpurneed_b是一张表
var detailGrid = Ext.getCmp("test_yearpurneed_b");
var store=detailGrid.getStore();
alert(1);
if(store.getCount() >= 0){
});
}
现在我要获取那个批复状态字段的值 这个字段在数据库对应的code是ireplystate
答
获取全部的还是什么?获取选中的用
var rows=store.getSelectionModel( ) .getSelection( );
if(rows.length>0)alert(rows[0].get('ireplystate'))//注意如果columns dataIndex配置不是这个自己修改过来
全部用store方法的each遍历
store.each(function(record){
alert(record.get('ireplystate'))
})
答
为什么要用store? 获取选中行不是更简单吗?