如何在extjs网格中禁用行选择。在extjs网格中禁用行
8
A
回答
8
您必须将disableSelection属性设置为true。如果指定了SelectionModel,它的值将被忽略。
例如:
var grid = new Ext.grid.GridPanel({
disableSelection: true,
store: new Ext.data.Store({
reader: reader,
data: xg.dummyData
}),
columns: [
{id:'company', header: "Company", width: 200, sortable: true, dataIndex: 'company'},
{header: "Price", width: 120, sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
{header: "Change", width: 120, sortable: true, dataIndex: 'change'},
{header: "% Change", width: 120, sortable: true, dataIndex: 'pctChange'},
{header: "Last Updated", width: 135, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
],
viewConfig: {
forceFit: true,
// Return CSS class to apply to rows depending upon data values
getRowClass: function(record, index) {
var c = record.get('change');
if (c < 0) {
return 'price-fall';
} else if (c > 0) {
return 'price-rise';
}
}
},
width:600,
height:300,
frame:true,
title:'Framed with Checkbox Selection and Horizontal Scrolling',
iconCls:'icon-grid'
});
如果要禁用只有一些行的选择,你可以添加一个监听给selectionModel“beforerowselect”事件并返回false时,你不想一排是选择。
4
使用此配置,如果你没有为你网格
var grid = new Ext.grid.GridPanel({
disableSelection: true,
});
否则你这个小动作在RowSelectionModel禁用选择
var grid = new Ext.grid.GridPanel({
selModel : new Ext.grid.RowSelectionModel({selectRow: Ext.emptyFn})
});
1
相关问题
- 1. Extjs 3.3.3网格 - 禁用网格行
- 2. 如何在ExtJS 4.1中禁用网格中的某些行
- 3. Extjs禁用原生网格滚动
- 4. 在extjs中锁定网格中的行
- 5. 如何在ExtJS的分组网格中禁用折叠?
- 6. ExtJS设置菜单在网格中动态禁用
- 7. 在WPF数据网格中禁用行
- 8. combo.Setvalue在编辑extjs网格行之前调用extjs网格行在4.2但不在6.2中工作
- 9. 在表格中的网格在extjs
- 10. 如何禁用ExtJS网格中的控件?
- 11. 如何禁用ExtJS中的网格复选框?
- 12. 在网格上禁用默认排序extjs
- 13. Extjs 3中的网格的行大小
- 14. Extjs网格图标行对齐中心
- 15. 显示网格中的行数 - Extjs
- 16. 编辑ExtJs网格中的一行
- 17. 突出显示网格中的行 - extjs
- 18. 在网格内添加行extjs
- 19. 使用行扩展器在ExtJS 4.1中嵌套网格
- 20. 在Extjs网格视图中隐藏行不起作用
- 21. 使用EXTJS参数化显示在网格中的行数
- 22. 用extjs 4嵌套网格
- 23. 如何禁用自动滚动到ExtJS网格中的选定单元格?
- 24. 分页在网格extjs
- 25. extjs 4 getLastSeletedCell在网格
- 26. 当ext.window打开时禁用鼠标点击网格extjs 3
- 27. ExtJS的4禁用排序如果网格是空
- 28. extjs网格面板
- 29. ExtJS的RowEditor网格
- 30. Extjs属性网格
谢谢,但如果我有selectionModel呢。 – John 2010-10-21 17:33:03
是否要禁用所有行或某些行的选择? – ncardeli 2010-10-21 18:04:35
我想禁用所有行 – John 2010-10-22 04:32:42