【发布时间】:2017-05-11 14:29:58
【问题描述】:
提前感谢您的帮助...
我很难从 ExtJS 6 Grid 中选择第一行,在它从绑定中完全加载之后!
我已经尝试了几个事件,例如加载、boxready、afterrender 等……但似乎没有一个能奏效!
在网格从绑定中加载所有记录后,我应该使用什么事件从网格中选择一行?
任何例子都会很好地说明如何做到这一点。
这是我的网格:
{
xtype: 'gridpanel',
cls: 'user-grid',
routeId: 'languages',
itemId: 'mainGrid',
reference: 'mainGrid',
bind: '{languages}',
scrollable: false,
tbar: [
{
xtype: 'button',
text: 'foo',
toolTip: 'bar',
iconCls: 'x-fa fa-plus',
handler: 'onFooClick'
}
],
viewConfig: {
stripeRows: true,
getRowClass: function(record) {
var rowCls ='';
if (record.get('is_active') === false) {
rowCls = 'inactive-row';
}
if (record.get('is_system') === true) {
rowCls = 'system-row';
}
return rowCls;
}
},
columns: {
items: [
{
xtype: 'gridcolumn',
width: 40,
dataIndex: 'id',
text: 'id',
toolTip: 'the id'
},
{
xtype: 'gridcolumn',
cls: 'content-column',
dataIndex: 'name',
text: 'name',
toolTip: 'the name'
flex: 1
}
]
},
dockedItems: [
{
xtype: 'pagingtoolbar',
dock: 'bottom',
itemId: 'userPaginationToolbar',
reference: 'userPaginationToolbar',
displayInfo: true,
bind: '{languages}'
}
]
}
【问题讨论】:
标签: javascript extjs data-binding grid extjs6