Results 1 to 2 of 2

Thread: With CheckboxModel selection model Header Checkbox is checked on empty store

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-7104 in a recent build.
  1. #1
    Ext JS Premium Member
    Join Date
    Jun 2011
    Location
    Ottawa, Ontario, Canada
    Posts
    123

    Default With CheckboxModel selection model Header Checkbox is checked on empty store

    I see it in 4.1.2 nightly build of August 26.

    I used this override to fix it.

    Code:
    Ext.define('Ext.selection.CheckboxModel2', {
       override: 'Ext.selection.CheckboxModel',
       updateHeaderState: function() {
          // check to see if all records are selected
          var hdSelectStatus = this.selected.getCount() === this.store.getCount() && this.selected.getCount() != 0;
          this.toggleUiHeader(hdSelectStatus);
       }
    });
    Testcase:

    Code:
    Ext.define('Company', {
        extend : 'Ext.data.Model',
        fields : [
            {name : 'company'},
            {name : 'price', type : 'float'},
            {name : 'change', type : 'float'},
            {name : 'pctChange', type : 'float'},
            {name : 'lastChange', type : 'date', dateFormat : 'n/j h:ia'},
            {name : 'industry'},
            {name : 'desc'}
        ]
    });
    
    var sm = Ext.create('Ext.selection.CheckboxModel');
    var grid2 = Ext.create('Ext.grid.Panel', {
        store       : Ext.create('Ext.data.ArrayStore', {
            model : 'Company'
        }),
        selModel    : sm,
        columns     : [
            {text : "Company", width : 200, dataIndex : 'company'},
            {text : "Price", renderer : Ext.util.Format.usMoney, dataIndex : 'price'},
            {text : "Change", dataIndex : 'change'},
            {text : "% Change", dataIndex : 'pctChange'},
            {text : "Last Updated", width : 135, renderer : Ext.util.Format.dateRenderer('m/d/Y'), dataIndex : 'lastChange'}
        ],
        columnLines : true,
        width       : 600,
        height      : 300,
        frame       : true,
        title       : 'Framed with Checkbox Selection and Horizontal Scrolling',
        renderTo    : Ext.getBody()
    });
    Last edited by mitchellsimoens; 27 Aug 2012 at 12:19 PM. Reason: added test case

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •