Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    12
    Vote Rating
    0
    stan.cristian88 is on a distinguished road

      0  

    Default [4.0.7] 'select' event is fired when a grid is sorted if selection model is CellModel

    [4.0.7] 'select' event is fired when a grid is sorted if selection model is CellModel


    The simplest use case to reproduce this bug is the following:

    I just edited the example in the Ext.grid.Panel doc, in basic gridPanel live preview. Below is the edited code:

    Code:
    Ext.create('Ext.data.Store', {
        storeId:'simpsonsStore',
        fields:['name', 'email', 'phone'],
        data:{'items':[
            { 'name': 'Lisa',  "email":"lisa@simpsons.com",  "phone":"555-111-1224"  },
            { 'name': 'Bart',  "email":"bart@simpsons.com",  "phone":"555-222-1234" },
            { 'name': 'Homer', "email":"home@simpsons.com",  "phone":"555-222-1244"  },
            { 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254"  }
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    
    Ext.create('Ext.grid.Panel', {
        title: 'Simpsons',
        store: Ext.data.StoreManager.lookup('simpsonsStore'),
        columns: [
            { header: 'Name',  dataIndex: 'name' },
            { header: 'Email', dataIndex: 'email', flex: 1 },
            { header: 'Phone', dataIndex: 'phone' }
        ],
        height: 200,
        width: 400,
        renderTo: Ext.getBody(),
        selType:'cellmodel',
        listeners:{
            'select':function(cell, rec, row, col) {
                alert('cell at position ' + row + ' | ' + col + ' was selected');
            }
        }
    });
    So the only changes I made are:
    - added selType: 'cellmodel' to grid config
    - added a select listener that will show a pop-up with the selected cell coordinates when the select event is fired.

    Expected behaviour:
    - the alert pop-up should be showed only when a cell is clicked/selected

    Actual behaviour:
    - if a cell was clicked, pressing on one of the table headers to sort the data will trigger the select event and the pop-up will be displayed. Example: click on the first cell: a pop-up with 'cell at position 0 | 0 was selected' will be showed. Then click on 'Email' header to sort the grid, and again the same pop-up will be showed. After that the cell is deselected.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,347
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    This example seems to be working fine in 4.1.0.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1