简体   繁体   English

带有复选框的 Extjs 网格面板

[英]Extjs grid panel with checkboxes

我如何使用这里的复选框创建 ExtJs 网格面板。

In Ext 3.4, you'll want to use the Ext.grid.CheckColumn plugin as demonstrated in the EditorGrid sample included in the framework download.在 Ext 3.4 中,您需要使用Ext.grid.CheckColumn插件,如框架下载中包含的 EditorGrid 示例中所示。

In Ext 4+ there is a CheckColumn type built-in ( xtype: 'checkcolumn' ).在 Ext 4+ 中有一个内置的 CheckColumn 类型( xtype: 'checkcolumn' )。

Here's an example of what the column config looks like for a checkbox column in version 4+:以下是版本 4+ 中复选框列的列配置示例:

  xtype: 'checkcolumn',
  header: 'Active?',
  dataIndex: 'active', // model property to bind to
  width: 60,
  editor: {
    xtype: 'checkbox',
    cls: 'x-grid-checkheader-editor'
  }

The previous answers don't seem to work anymore in latest ExtJs version. 以前的答案似乎不再适用于最新的ExtJs版本。 Link to the working example is here : example ExtJs 4.1 链接到工作示例如下: 示例ExtJs 4.1

How about using this?用这个怎么样?

var checkBoxSelMod = new Ext.grid.CheckboxSelectionModel();

:-D :-D

You can switch position of check box by placing the selection model object at desired position in the column list.您可以通过将选择模型对象放置在列列表中的所需位置来切换复选框的位置。 This will allow you to place multiple checkboxes in the grid.这将允许您在网格中放置多个复选框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM