gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 00:39:41 24 4
gpt4 key购买 nike

我想为我的 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com