extjs 中怎么得到GridPanel中显示的列的id或者dataIndex?

部分代码:vargrid=newExt.grid.GridPanel({title:'。。。。。',id:'grid',loadMask:{msg:'正在加载数据,请稍侯... 部分代码:
var grid = new Ext.grid.GridPanel({ title:'。。。。。', id : 'grid', loadMask : {msg : '正在加载数据,请稍侯……'}, store : store, cm : new Ext.grid.ColumnModel(acm), bbar : new Ext.PagingToolbar({pageSize :20,store : store,displayInfo : true}), region : 'center', border : false, loadMask : true, stripeRows : true, trackMouseOver : true, animCollapse : true});
var acm= [new Ext.grid.RowNumberer(), {header : 'cccc', dataIndex : 'name', sortable : true, id : 'name', width : 150}, {header : 'asdfasfd', dataIndex : 'notice', sortable : true, id : 'notice', width : 150}]; var bcm= [new Ext.grid.RowNumberer(), {header : 'agency', dataIndex : 'name', sortable : true, id : 'name', width : 150}, {header : 'notice', dataIndex : 'notice', sortable : true, id : 'notice', width : 150}]; var ccm= [new Ext.grid.RowNumberer(), {header : 'aaaa', dataIndex : 'name', sortable : true, id : 'name', width : 150}, {header : 'bbbb',dataIndex : 'teamName', sortable : true, id : 'teamName', width : 150}];
根据不同情况设置不同的列模型,我就是想问下有的列显示,有的列隐藏,怎么得到显示的列的值或这dataIndex都行。。。
还有就是每个列模型的列都不一样,怎么把所有显示的列的id组成一个数组或者拼接成字符串啊???
展开
 我来答
object8888
推荐于2016-12-04 · TA获得超过274个赞
知道小有建树答主
回答量:302
采纳率:100%
帮助的人:305万
展开全部
//extjs grid是没有列index的,他是只有行的index。
//你要获取列数据,其实也就是获取store里面的数据值。只能用遍历store的方法。
//比如你要获取name列的所有值,那么就遍历这个store。

var name_str;
for (var i = 0; i < store.getCount(); i++) {
var record = store.getAt(i);
alert(record.get('name'));
//name_str  = name_str + name;  //进行拼接

alert(name_str);
更多追问追答
追问
我说的是有的列隐藏,有的列显示,怎么得到显示的列的值并拼接成字符串。。。
追答
我给你的代码不是得到显示列 name 列的值么?
百度网友6bfc944
2013-12-19 · TA获得超过746个赞
知道小有建树答主
回答量:529
采纳率:0%
帮助的人:286万
展开全部
1746773660
追问
神马意思???
追答
QQ
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式