Results 1 to 2 of 2

Thread: disable grouping feature does not disable column menu "group by this field"

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    4
    Vote Rating
    1
      0  

    Default disable grouping feature does not disable column menu "group by this field"

    Ext version tested:
    4.1.3.548


    Browser versions tested against:
    FF16

    Description:

    Defining a grid panel and a store like this

    Code:
    var localStore = Ext.create('Ext.data.JsonStore', {
        name: 'localStore',
        fields: ['name', 'data', 'skill'],
        data: [
    { 'name': 'metric one',   'data': 10, 'skill':'skill3' },
            { 'name': 'metric two',   'data':  7, 'skill':'skill3' },
            { 'name': 'metric three', 'data':  5, 'skill':'skill3' },
            { 'name': 'metric four',  'data':  2, 'skill':'skill2' },
            { 'name': 'metric five',  'data': 27, 'skill':'skill1' }
        ]
    });
    
    
    
    var sampleGrid = Ext.create('Ext.grid.Panel', {
        title: 'Sample store',
        store: localStore,
        width: 700,
        height: 700,
        features: [
            Ext.create('Ext.grid.feature.GroupingSummary', {
                id: 'groupSummary',
                groupHeaderTpl: '{name} ({rows.length})'
            })        
        ],
    
        columns: [
    { text: 'name',  dataIndex: 'data', width:300},
    { text: 'skill',  dataIndex: 'skill' }
        ],
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });
    I would assume that

    Code:
    sampleGrid.getView().getFeature('groupSummary').disable();
    will disable the grouping feature AND disable the grouping-column Menu ("group by this field")

    However even after using the "disable" method on the feature, the column menu in the grid panel can still be clicked by the user. Thus "disabling" the grouping feature is only possible by iterating over all configured columns and set the "groupable" property to "false"

    Code:
    for (var i in sampleGrid.columns) {
                console.log("disable groupable on column" + sampleGrid.columns[i].dataIndex);
                sampleGrid.columns[i].groupable = false;
    }
    This will then also disable the column menu "Group by this field".
    However I would assume that using the
    Code:
    getFeature('groupSummary').disable()
    I can achieve the same effect without the need to iterate over all defined columns.
    Last edited by imc-pp; 7 Jan 2013 at 5:29 AM. Reason: corrected test case

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,413
    Vote Rating
    1269
      0  

    Default

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

Tags for this Thread

Posting Permissions

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