作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想为我的 extjs 网格设置一个复选框(true/false)。当我尝试添加 xtype 的项目时:'checkbox' 我收到错误消息:
Uncaught TypeError: column.isColumnHidden is not a function
我在一篇帖子上看到有一个复选框列的插件需要下载并包含在 ExtJS 中,ExtJS 5 中没有内置选项用于网格中的复选框吗?
最佳答案
当我使用复选框时,我从官方网站下载 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'
}
]
}
您还尝试添加到复选框 dataIndex
字段并为其设置模型中的一些 bool 变量。祝你好运!
关于extjs - 如何将复选框列添加到 ExtJS 5 网格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30505602/
我是一名优秀的程序员,十分优秀!