grid.getSelectionModel().getSelected is not a function
2013-11-08 14:44
633 查看
因为Extjs 的Ext.grid.EditorGridPanel默认是行选择,所以如果你点击一个CELL再用这个方法是会报错的,解决方法是在grid定义时加上
sm: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
就可以用grid.getSelectionModel().getSelected这个方法了,具体代码如下:
var grid = new Ext.grid.EditorGridPanel({
id: ‘stylegrid’,
wdith:290,
height:290,
store : gridstore,
sm: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
columns: [
{
header: 'apBasicId',
dataIndex: 'apBasicId',
hidden: true,
},{
header:'款号',
width: 100,
sortable: true,
dataIndex: 'style',
},{
header:'款号名字',
width: 100,
sortable: true,
dataIndex: 'stylename',
}]
});
sm: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
就可以用grid.getSelectionModel().getSelected这个方法了,具体代码如下:
var grid = new Ext.grid.EditorGridPanel({
id: ‘stylegrid’,
wdith:290,
height:290,
store : gridstore,
sm: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
columns: [
{
header: 'apBasicId',
dataIndex: 'apBasicId',
hidden: true,
},{
header:'款号',
width: 100,
sortable: true,
dataIndex: 'style',
},{
header:'款号名字',
width: 100,
sortable: true,
dataIndex: 'stylename',
}]
});
相关文章推荐
- this.getColumnModel is not a function Extjs 如何解决呢? Extjs 导出 到Excel 解决方案问题
- Angular 1.6提示$http.get(...).success is not a function
- TypeError: atlas.getSpriteFrame is not a function
- The function getXX must be used with a prefix when a default namespace is not specified
- grid.getSelectionModel的所有操作【转】
- 海康web视频插件错误:TypeError: c.HWP_GetLocalConfig is not a function
- extjs RowSelectionModel getSelected方法
- Uncaught TypeError: this.canvas.getContext is not a function
- Ext4.0.7使用Ext.grid.ColumnModel报错:TypeError: Ext.grid.Model is not a constructor
- 关于The function get must be used with a prefix when a default namespace is not specified的错误
- 奇怪的TypeError: Error #1006: getInstance is not a function.
- Canvas使用错误:screen.getContext('2d') is not a function
- Scriptaculous 中的 "... getStyle is not a function." 错误
- grid.getSelectionModel的所有操作
- grid.getSelectionModel()的所有操作
- nodeHandle.getHostNode is not a function
- js报错:TypeError: document.GetElementById is not a function
- 编译bada的sample时,ERROR: The model is not selected
- document.getElementById().submit is not a function
- grid.getSelectionModel()的所有操作