问题描述
- getSelectionModel().getSelections()什么意思
-
var cumgrid = new Ext.grid.GridPanel({ width:600, autoHeight:true, //列重新计算后自动填满[Ext.grid.GridView] viewConfig:{ forceFit:true, columnsText:"显示的列", sortAscText:"升序", sortDescText:"降序" }, store:store, cm:cm, sm:sm, renderTo:"cumgrid" }); store.load(); cumgrid.on("click",function(){ var selections = cumgrid.getSelectionModel().getSelections(); for(var i=0;i<selections.length;i++){ var record = selections[i]; Ext.Msg.alert("提示","您所选中的行的编号为"+record.get("memid")+",名称为"+record.get("memName")); } });
解决方案
ext中
cumgrid.getSelectionModel().getSelections()是选中的行数据
解决方案二:
Returns an array of the currently selected records.获取gridpanel当前选中的数据行
http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.grid.Panel-method-getSelectionModel
http://docs.sencha.com/extjs/4.1.3/#!/api/Ext.selection.Model
时间: 2024-10-12 19:55:59