Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Tree Grid using Checkbox Model

  1. #11
    Sencha Premium Member
    Join Date
    Mar 2015
    Posts
    11
    Answers
    1

    Default

    Hi Tristan,

    Thanks a lot for your response. I found 1 solution without using the checkbox model at https://fiddle.sencha.com/#fiddle/hfs

    In the above case they have used a normal grid. I did modify the select all function to implement what was needed in case of a tree structure.

    onSelectAll: function(store, column, checked) {
    store.getRootNode().cascadeBy(function(child) {
    if (checked) {
    child.set('check', true);
    } else {
    child.set('check', false);
    }
    });
    }

    Now, i am facing another issue in the internal parent child nodes where on selection of parent nodes, i am not able to get child nodes reference. I am using the below code.

    {
    xtype: 'fiddlecheckcolumn',
    dataIndex: 'check',
    flex: 0.25,
    listeners: {
    checkchange: function(column, recordIndex, checked) {
    console.log(column);
    }
    }

    On clicking of checkbox in the grid i am getting the listener checkchange function working, but from there i am neither able to get the store or able to get node object to cascade child nodes.

    Would you be able to provide me some reference? Thanks a lot.

    Regards,
    Gul

  2. #12
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    Can you provide what you had working, implementing that onSelectAll function above, in a fiddle so I can reproduce the issue?

  3. #13
    Sencha Premium Member
    Join Date
    Mar 2015
    Posts
    11
    Answers
    1

    Default

    Hi Tristan,

    I have created a fiddle for my implementation

    https://fiddle.sencha.com/#fiddle/luf

    1. Now, when we click on the record for Bart, the records for Homer and Marge should also be selected.

    2. On clicking of checkbox in the grid i am getting the listener checkchange function working, but from there i am neither able to get the store or able to get node object to cascade child nodes.

    3. You could see the checkchange function being activated since i have placed an alert there. I need your help on getting the functionality mentioned in point 1. If we have objects as specified in point 2, it would also help.

    Please let me know.

    Regards,
    Gul

  4. #14
    Sencha Premium Member
    Join Date
    Mar 2015
    Posts
    11
    Answers
    1

    Default

    Hi Tristan,

    Please let us know if you got a chance to have a look at our issue and have some resolution for us.

    Regards,
    Gul Suhanda

  5. #15
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,579
    Answers
    165

    Default

    Gul,

    Take a look at this fiddle to see if it gets you what you're looking for. In the checkchange event, I reference the TreePanel and get the Store and the node at the specified recordIndex. I can then use that node and cascade the children and (un)check them as needed.



    Hope this helps,
    Tristan

  6. #16

    Default Amazing Solution

    Quote Originally Posted by tristan.lee View Post
    Gul,

    Take a look at this fiddle to see if it gets you what you're looking for. In the checkchange event, I reference the TreePanel and get the Store and the node at the specified recordIndex. I can then use that node and cascade the children and (un)check them as needed.



    Hope this helps,
    Tristan
    Hello Tristan, that was an amazing solution for me! Thanks
    Thanks
    Albanir Neves

Page 2 of 2 FirstFirst 12

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
  •