开发者

how to add checkbox column to Extjs Grid

开发者 https://www.devze.com 2023-01-08 07:09 出处:网络
I have EXTjs grid. I want to know how to add the checkbox to the Extjs grid column. in my datatable I\'ll get the value for the column \'Status\'. it may br either true/false. so based on that it sho

I have EXTjs grid. I want to know how to add the checkbox to the Extjs grid column.

in my datatable I'll get the value for the column 'Status'. it may br either true/false. so based on that it should show the checkb开发者_运维技巧ox column checked / unchecked.


Have a look at the sample here. It uses a Plugin called CheckBoxColumn (you will have to View Source and find the JS file.

Some example usage from the Plugin's file...


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
    ...
});


0

精彩评论

暂无评论...
验证码 换一张
取 消