我有EXTjs网格。我想知道如何将复选框添加到Extjs网格列。
在我的数据表中,我将获得“状态”列的值。它可能是真/假。所以基于它应该显示复选框列已选中/未选中。
答案 0 :(得分:9)
查看示例here。它使用一个名为CheckBoxColumn的插件(您必须查看源代码并找到JS文件。
插件文件中的一些示例用法......
var checkColumn = new Ext.grid.CheckColumn({
header: 'Indoor?',
dataIndex: 'indoor',
id: 'check',
width: 55
});
// add the column to the column model
var cm = new Ext.grid.ColumnModel([{
header: 'Foo',
...
},
checkColumn
]);
// create the grid
var grid = new Ext.grid.EditorGridPanel({
...
cm: cm,
plugins: [checkColumn], // include plugin
...
});