0

please look into following images let me know if you have any solution for it,

when I click on select all header checkbox (last column of grid) at that time if grid having row in collapse mode at that time all the record get selected but header checkbox remains unchecked but when I expand that particular record grid then header checkbox get selected please help me with it.

how can we get checked header checkbox while grid data in collapse mode.

enter image description here

enter image description here

  • I guess you will have to check it in the check event of the editor. In an event handler just check if all have been checked and manualy set the header to checked. If you could provide some of your code, I could help you out better. – taubi19 Apr 06 '16 at 10:19
  • addTreeGrid: function( view, type ) { var me = this, grid = null; grid = Ext.create( 'widget.documentgrid', { selModel: new Ext.selection.CheckboxModel({ injectCheckbox:'last', checkOnly: true, listeners : {//Issue # 7066 : t3281034 beforeselect : function(model, record, index){ if( record.get('status') === 'ANNL' ){ return false; } } } }) } ); – Manish Peke Apr 07 '16 at 12:24

2 Answers2

0

Got an answer just override method onHeaderClick see commented lines,

`onHeaderClick: function(headerCt, header, e) {
if (header.isCheckerHd) { e.stopEvent(); var me = this, isChecked = header.el.hasCls(Ext.baseCSSPrefix + 'grid-hd-checker-on');

                    // Prevent focus changes on the view, since we're selecting/deselecting all records
                    me.preventFocus = true;
                    if (isChecked) {
                        me.deselectAll();
                        me.toggleUiHeader(false); // added
                    } else {
                        me.selectAll();
                        me.toggleUiHeader(true); // added
                    }
                }
0

Please find code snippet below

addTreeGrid: function( view, type ) {
    var me = this,
        grid = null;
    grid = Ext.create( 'widget.documentgrid', {
        selModel: new Ext.selection.CheckboxModel({
            injectCheckbox:'last',
            checkOnly: true,
            listeners : {//Issue # 7066 : t3281034
                beforeselect : function(model, record, index){
                    if( record.get('status') === 'ANNL' ){
                        return false;                       
                    }
                }
            }
        })
    } );
slax0r
  • 688
  • 4
  • 8