Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将复选框列添加到ExtJS 5网格?_Extjs - Fatal编程技术网

如何将复选框列添加到ExtJS 5网格?

如何将复选框列添加到ExtJS 5网格?,extjs,Extjs,我想为我的extjs网格设置一个复选框(true/false)。 当我尝试添加xtype:“复选框”项时,我收到一个错误: 未捕获类型错误:column.isColumnHidden不是函数 我在一篇帖子上看到,有一个checkbox列插件需要下载并包含在ExtJS中,ExtJS 5中是否有网格中checkbox的内置选项?当我使用checkbox时,我从官方网站下载ExtJS库,并通过ExtJS控制台构建if的开发版本 我的带有复选框的extjs网格如下所示: { xtype:'che

我想为我的extjs网格设置一个复选框(true/false)。 当我尝试添加xtype:“复选框”项时,我收到一个错误:

未捕获类型错误:column.isColumnHidden不是函数


我在一篇帖子上看到,有一个checkbox列插件需要下载并包含在ExtJS中,ExtJS 5中是否有网格中checkbox的内置选项?

当我使用checkbox时,我从官方网站下载ExtJS库,并通过ExtJS控制台构建if的开发版本

我的带有复选框的extjs网格如下所示:

{
    xtype:'checkcolumn',
    fieldLabel: 'checkbox_label',
    name: 'checkbox_name',
    text: 'text'
}
{
    xtype: 'grid',
    frame: true,
    title: 'Users',
    collapsible: true,
    height: 250,
    bind: '{depGrid.selection.users}',
    columns: [
        {
            text: 'Id',
            dataIndex: 'id'
        },
        {
            text: 'Name',
            dataIndex: 'name'
        },
        {
            xtype:'checkcolumn',
            fieldLabel: 'checkbox_label',
            name: 'checkbox_name',
            text: 'text'
        }
    ]
}
因此,完整的网格代码如下所示:

{
    xtype:'checkcolumn',
    fieldLabel: 'checkbox_label',
    name: 'checkbox_name',
    text: 'text'
}
{
    xtype: 'grid',
    frame: true,
    title: 'Users',
    collapsible: true,
    height: 250,
    bind: '{depGrid.selection.users}',
    columns: [
        {
            text: 'Id',
            dataIndex: 'id'
        },
        {
            text: 'Name',
            dataIndex: 'name'
        },
        {
            xtype:'checkcolumn',
            fieldLabel: 'checkbox_label',
            name: 'checkbox_name',
            text: 'text'
        }
    ]
}

此外,您还可以尝试添加到复选框
dataIndex
字段,并将模型中的一些布尔变量设置为该字段。祝你好运

你能发布一个提琴吗?因为我一直在获取错误:column.isColumnHidden在添加你编写的确切代码时不是函数。正确的X类型是checkcolumn,更新你的答案,我会接受它。这解决了我的问题,非常不幸的是,sencha无法提供与correc xtype:checkcolumn实际相关的错误消息