如何删除 extjs checkboxmodel 中的 checkall 选项?

发布于 2024-12-03 11:02:43 字数 121 浏览 1 评论 0原文

如何删除检查所有选项是 extjs 4 checkboxmodel?

在此处输入图像描述

问候

How to remove check all option is extjs 4 checkboxmodel?

enter image description here

Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

Saygoodbye 2024-12-10 11:02:43

定义网格时(在 4.2.1 中),将此配置选项设置为:(

selModel: Ext.create('Ext.selection.CheckboxModel', { showHeaderCheckbox: false }),

相关部分为 showHeaderCheckbox :false

When defining a grid (in 4.2.1), set this config option to:

selModel: Ext.create('Ext.selection.CheckboxModel', { showHeaderCheckbox: false }),

(The relevant part is showHeaderCheckbox :false)

风流物 2024-12-10 11:02:43

我已经设法使用纯 CSS 隐藏它:

代码:

.x-column-header-checkbox {display:none;}  

I have managed to hide it using pure CSS:

Code:

.x-column-header-checkbox {display:none;}  
遮云壑 2024-12-10 11:02:43

创建 checkboxmodel 时,尝试在其配置中指定 injectCheckbox: false来自 API

指示 SelectionModel 是否自动注入复选框标头。 (注意:如果不手动放置该复选框,网格视图将需要在初始渲染时渲染 2 倍。)支持的值包括数字索引、 false 以及字符串“first”和“last”。

When you're creating your checkboxmodel, try specifying injectCheckbox: false into its configuration. From the API:

Instructs the SelectionModel whether or not to inject the checkbox header automatically or not. (Note: By not placing the checkbox in manually, the grid view will need to be rendered 2x on initial render.) Supported values are a Number index, false and the strings 'first' and 'last'.

甜`诱少女 2024-12-10 11:02:43

使用 jquery 内部网格面板 afterrender 事件

listeners: {

        afterrender: function (grid) {
           $('.x-column-header-checkbox').css('display','none');
        }
    }

Inside grid panel afterrender event using jquery

listeners: {

        afterrender: function (grid) {
           $('.x-column-header-checkbox').css('display','none');
        }
    }
百思不得你姐 2024-12-10 11:02:43

根据API,“header”属性的类型是String。也就是说,正确的值为''。它在 ExtJS 3.4 上对我有用

this.queueSelModel = new Ext.grid.CheckboxSelectionModel({
            singleSelect : true, // or false, how you like
            header : ''
        });

According to API, the type of "header" property is String. Said that, the correct value is ''. It has worked for me on ExtJS 3.4

this.queueSelModel = new Ext.grid.CheckboxSelectionModel({
            singleSelect : true, // or false, how you like
            header : ''
        });
阿楠 2024-12-10 11:02:43

配置中的 heder:false 或jectCheckBoxHeader = false 隐藏整个列。 CSS 解决方案是基于类的,因此使用相同选择模型的任何其他小部件也会隐藏整个检查。

heder:false in config or injectCheckBoxHeader = false hide the entire column. CSS solution is class based so any other widget using the same selection model would also hide the entire check.

梦行七里 2024-12-10 11:02:43

在 ExtJS 4 中,可以提供如下标头配置,以在标头中显示空白或自定义文本。

getHeaderConfig: function() {
                var me = this;
                showCheck = false;
                return {
                    isCheckerHd: showCheck,
                    text : ' ',
                    width: me.headerWidth,
                    sortable: false,
                    draggable: false,
                    resizable: false,
                    hideable: false,
                    menuDisabled: true,
                    dataIndex: '',
                    cls: showCheck ? Ext.baseCSSPrefix + 'column-header-checkbox ' : '',
                    renderer: Ext.Function.bind(me.renderer, me),

                    //me.renderEmpty : renders a blank header over a check box column
                    editRenderer: me.editRenderer || me.renderEmpty,
                    locked: me.hasLockedHeader()
                };

            },

In ExtJS 4 a header config can be provided as below to display a blank or custom text in the header.

getHeaderConfig: function() {
                var me = this;
                showCheck = false;
                return {
                    isCheckerHd: showCheck,
                    text : ' ',
                    width: me.headerWidth,
                    sortable: false,
                    draggable: false,
                    resizable: false,
                    hideable: false,
                    menuDisabled: true,
                    dataIndex: '',
                    cls: showCheck ? Ext.baseCSSPrefix + 'column-header-checkbox ' : '',
                    renderer: Ext.Function.bind(me.renderer, me),

                    //me.renderEmpty : renders a blank header over a check box column
                    editRenderer: me.editRenderer || me.renderEmpty,
                    locked: me.hasLockedHeader()
                };

            },
千纸鹤 2024-12-10 11:02:43

我在 ExtJS 4.0.7 版本中遇到了这个问题。
首先,我删除了复选框布局:

.rn-grid-without-selectall .x-column-header-checkbox .x-column-header-text
{
    display: none !important;
}

然后我在网格的渲染后侦听器中使用了以下代码:

afterrender: function (grid) {
    this.columns[0].isCheckerHd = false;
}

这不是一个好的解决方案,但可以用作起点。

I encountered this issue in ExtJS 4.0.7 version.
First I removed checkbox layout:

.rn-grid-without-selectall .x-column-header-checkbox .x-column-header-text
{
    display: none !important;
}

Then I used the following code in afterrender listener of the grid:

afterrender: function (grid) {
    this.columns[0].isCheckerHd = false;
}

It is not a good solution but it can be used as a starting point.

肤浅与狂妄 2024-12-10 11:02:43

感谢这里所有的好提示。
对于 Sencha 3.4,这是我最终使用的极其简单的纯 CSS,

My_Panel_With_a_Grid_Without_Header_CheckBox = Ext.extend(Ext.Panel, {....
cls: '内面板 hiddeGridCheckBoxOnSingleSelect',
....}

在我的 CCS 文件中:

.hiddeGridCheckBoxOnSingleSelect .x-grid3-hd-checker {
可见性:隐藏
}

Thanks for all the good hints here.
For Sencha 3.4, this is the extremely simple pure CSS I ended up using,

My_Panel_With_a_Grid_Without_Header_CheckBox = Ext.extend(Ext.Panel, {....
cls: 'innerpanel hiddeGridCheckBoxOnSingleSelect',
....}

in my CCS file:

.hiddeGridCheckBoxOnSingleSelect .x-grid3-hd-checker {
visibility:hidden
}

薯片软お妹 2024-12-10 11:02:43

在 checkboxselectionModel 中定义 {Header: false}

this.queueSelModel = new Ext.grid.CheckboxSelectionModel({
            singleSelect : false,
            header : false
        });

Define {Header: false} in checkboxselectionModel

this.queueSelModel = new Ext.grid.CheckboxSelectionModel({
            singleSelect : false,
            header : false
        });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文