我想为我的extjs网格设置一个复选框(true / false)。当我尝试添加xtype项:“复选框”时,出现错误:
未捕获的TypeError:column.isColumnHidden不是函数
我在一篇帖子中看到,有一个checkbox列的插件需要下载并包含在ExtJS中,ExtJS 5中没有用于网格中的checkbox的内置选项吗?
当我使用复选框时,我从官方站点下载extjs库,并通过extjs控制台构建if的开发版本。
我的带有复选框的extjs网格如下所示:
{
xtype:'checkcolumn',
fieldLabel: 'checkbox_label',
name: 'checkbox_name',
text: 'text'
}
Run Code Online (Sandbox Code Playgroud)
因此完整的网格代码将如下所示:
{
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'
}
]
}
Run Code Online (Sandbox Code Playgroud)
您也可以尝试添加到复选框dataIndex字段,并从模型中为其设置一些布尔变量。祝好运!