gridview - 如何将复选框列添加到 Extjs 网格

标签 gridview checkbox extjs

我有 EXTjs 网格。我想知道如何将复选框添加到 Extjs 网格列。

在我的数据表中,我将获取“状态”列的值。它可能是真/假。因此,基于此,它应该显示复选框列已选中/未选中。

最佳答案

查看示例 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
    ...
});


关于gridview - 如何将复选框列添加到 Extjs 网格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3315843/

相关文章:

java - 自定义 ArrayAdapter 从左下角填充 GridView

php - 如何显示附加复选框并在ajax调用后自动选中

javascript - 使用 id 获取面板的标题

c# - 从 GridView 中删除行

c# - 无法将类型 'string' 隐式转换为 'System.Web.UI.WebControls.Label'

html - 如何在 ionic 中获取 ionic 复选框的值?

extjs 网格面板不显示滚动条

extjs - 在自定义组件中动态加载数据

gridview - 如何获取值以从组合框 extjs 4 传递参数

javascript - 检测复选框上的 "enter"keyup 事件