Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: [4.0.2] Selection model returns wrong record when Grouping feature is enabled

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-7893 in 4.2.2.1144.
  1. #21
    Touch Premium Member
    Join Date
    Mar 2007
    Posts
    60

    Default

    This also works with me, with one amendment. For some reason the datachanged event wasn't firing, it's update instead. So I changed that in fireEvent and it's working now. Thanks!

  2. #22
    Sencha Premium User
    Join Date
    Sep 2011
    Posts
    123

    Default

    Glad to hear it's working well for others! Has anyone used the fix in ExtJS versions other than 4.1.3?

  3. #23

    Default

    Hi,

    I've just stumbled across this problem too. I realise it's fixed in the latest framework release, but if, like me, you are still using 4.2.1 here is another option for working round it.


    All the handler functions I have used that handle a grid event pass in the underlying 'tr' html element corresponding to the row of the grid table. Once you have a reference to this element you can use
    Code:
    node.getAttribute('data-recordId')
    to return the id of the item in the underlying store backing the grid. Once you have an id you can use
    Code:
    store.getById(id)
    to return the actual item that was clicked on. In all my testing the 'data-recordId' remains constant even when expanding an collapsing groups; it is the 'data-recordIndex' that seems to go wrong.

    I've had to go down this route because I'm using Sencha Architect and couldn't find a nice way of handling the override solutions suggested in the rest of this thread. Hope it helps someone.

  4. #24
    Sencha Premium Member
    Join Date
    Jul 2010
    Location
    Torreon
    Posts
    8

    Thumbs up Working solution

    I had the same situation, and ask sencha support. They return me this:

    Ext.define('Ext.overrides.view.Table', {
    override: 'Ext.view.Table',
    getRecord: function(node) {
    node = this.getNode(node);
    if (node) {
    return this.dataSource.data.get(node.getAttribute('data-recordId'));
    }
    },
    indexInStore: function(node) {
    node = this.getNode(node, true);
    if (!node && node !== 0) {
    return -1;
    }
    return this.dataSource.indexOf(this.getRecord(node));
    }
    });

    I added it to my app.js on my launch function and it worked great! Hope this help someone

Page 3 of 3 FirstFirst 123

Posting Permissions

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