如何在 extjs 3 网格中 select 行以及如何放置过滤器
How to select row in extjs 3 grid and How to put fiilter
我在 EXTJS 3 中创建了一个网格。我想选择一行,为此我需要在行的开头得到一个复选框之类的东西。请任何人帮助我,我应该使用哪种配置。
还有如何给列过滤器。
我的密码是
{
xtype: 'grid',
id: 'C_GRID',
height:500,
selType: 'checkboxmodel',
frame: true,
autoHeight: true,
stripeRows: true,
store: myStor,
columns : this.columns,
bbar: [{
xtype: 'button',
text: 'ABC',
handler: function() {
// debugger;
}
}, {
xtype: 'button',
text: 'XYZ',
handler: function() {
//debugger;
}
}],
}
如果你使用的是ExtJS 3版本,那么你必须给网格配置sm。
您的代码片段的副本:
{
xtype: 'grid',
id: 'C_GRID',
height:500,
sm: new Ext.grid.CheckboxSelectionModel({singleSelect:true}),
frame: true,
autoHeight: true,
}
您可以使用 :
获取选定的行
Ext.getCmp('C_GRID').getSelectionModel().getSelected();
我在 EXTJS 3 中创建了一个网格。我想选择一行,为此我需要在行的开头得到一个复选框之类的东西。请任何人帮助我,我应该使用哪种配置。 还有如何给列过滤器。 我的密码是
{
xtype: 'grid',
id: 'C_GRID',
height:500,
selType: 'checkboxmodel',
frame: true,
autoHeight: true,
stripeRows: true,
store: myStor,
columns : this.columns,
bbar: [{
xtype: 'button',
text: 'ABC',
handler: function() {
// debugger;
}
}, {
xtype: 'button',
text: 'XYZ',
handler: function() {
//debugger;
}
}],
}
如果你使用的是ExtJS 3版本,那么你必须给网格配置sm。
您的代码片段的副本:
{
xtype: 'grid',
id: 'C_GRID',
height:500,
sm: new Ext.grid.CheckboxSelectionModel({singleSelect:true}),
frame: true,
autoHeight: true,
}
您可以使用 :
获取选定的行Ext.getCmp('C_GRID').getSelectionModel().getSelected();