如何将复选框列添加到Extjs Grid(how to add checkbox column to Extjs Grid)

系统教程 行业动态 更新时间:2024-06-14 17:03:54
如何将复选框列添加到Extjs Grid(how to add checkbox column to Extjs Grid)

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

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

I have EXTjs grid. I want to know how to add the checkbox to the Extjs grid column.

in my datatable I'll get the value for the column 'Status'. it may br either true/false. so based on that it should show the checkbox column checked / unchecked.

最满意答案

看看这里的示例。 它使用名为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 ... });

Have a look at the sample here. It uses a Plugin called CheckBoxColumn (you will have to View Source and find the JS file.

Some example usage from the Plugin's file...

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 ... });

更多推荐

本文发布于:2023-04-24 14:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/47d3a1cfeca243a6b7dfcc426b12ad25.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   复选框   Extjs   Grid   checkbox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!