How to remove checkall in extjs checkboxmodel?

How to remove all checkboxes - extjs 4 checkboxmodel option?

enter image description here

Hi

+6
source share
10 answers

I managed to hide it using pure CSS:

the code:

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

When defining a grid (in 4.2.1), set this configuration parameter:

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

(Relevant part of showHeaderCheckbox :false )

+6
source

When you create your checkboxmodel , try injectCheckbox: false in its configuration. From the API :

Tells SelectionModel whether to enter a checkbox title automatically or not. (Note: Without manually checking the box, the grid view should be displayed 2x at the initial render.) The supported values ​​are the Number, false index, and the lines "first" and "last".

+1
source

According to the API, the type of the header property is String. The correct value is said to be. '' It worked for me on ExtJS 3.4

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

Afterrender event inside a panel using jquery

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

heder: false in config or injectCheckBoxHeader = false hides the entire column. The CSS solution is class-based, so any other widget using the same selection model will also hide the entire validation.

0
source

In ExtJS 4, the header configuration can be presented below to display empty 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() }; }, 
0
source

I ran into this problem in ExtJS 4.0.7. First I removed the checkbox layout:

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

Then I used the following code in a mesh listener:

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

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

0
source

Thanks for all the good tips here. For Sencha 3.4, this is the extremely simple pure CSS I used,

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}

0
source

Define {Header: false} in checkboxselectionModel

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

Source: https://habr.com/ru/post/896721/


All Articles