Results 1 to 2 of 2

Thread: Setting Checked Programmitcally Does Not Work for a Tree Panel

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member Trevor4001's Avatar
    Join Date
    Sep 2013
    Posts
    114

    Default Setting Checked Programmitcally Does Not Work for a Tree Panel

    Ext version tested:


    • Ext 6.5.0 rev 775


    Browser versions tested against:


    • Chrome 70.0.3538.102


    DOCTYPE tested against:


    • html



    Description:


    • Setting the value of checked on an Ext.data.NodeInterface does not update parent nor child nodes in a tree panel when Ext.tree.Panel.checkPropogation is set to "both".


    https://fiddle.sencha.com/#view/editor&fiddle/2o28


    Steps to reproduce the problem:


    • Create a tree panel with checkPropogation set to "both" and the nodes not checked.
    • Set the value of checked for a parent node to true .


    The result that was expected:


    • The parent's child nodes should be checked.


    The result that occurs instead:


    • The parent's child nodes are not checked


    Workaround:



    Code:
    /*
      Fiddle.tree.View overrides Ext.tree.View to address bugs in Ext JS.
    */
    Ext.define('Fiddle.tree.View', {
      override: 'Ext.tree.View',
      requires: [
        'Ext.Array'
      ],
    
      handleUpdate: function (
          store,
          record,
          operation,
          changedFieldNames,
          info,
          allColumns) {
        this.callParent(arguments);
        // Ext JS Bug: Setting checked programmitcally does not work for a tree panel.
        // https://www.sencha.com/forum/showthread.php?471067
        if (!this.isChecking &&
              Ext.Array.contains(changedFieldNames, 'checked')) {
          // SetChecked expects the value of checked to not yet have been set.
          var checked = record.get('checked');
          record.set('checked', !checked, { silent: true });
          this.setChecked(record, checked, null, { silent: true });
        }
      },
    
      setChecked: function (record, meChecked, e, options) {
        this.isChecking = true;
        this.callParent(arguments);
        this.isChecking = false;
      }
    });
    Trevor Karjanis

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006

    Default

    Hi Trevor,
    Thank you for bringing this to our attention. I have shared this information with the support team and asked that they look into this at their earliest convenience. Your patience is greatly appreciated.

    Michele

Similar Threads

  1. Replies: 2
    Last Post: 12 Nov 2014, 11:35 AM
  2. Set tree panel node checked, programmatically
    By bwilson in forum Ext: Q&A
    Replies: 1
    Last Post: 24 May 2012, 10:37 AM
  3. Help In Getting the Nodes Checked in for the tree Panel.
    By er.viveksharma in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 1 Apr 2011, 10:53 AM
  4. Filtering the checked nodes in a Tree Panel
    By parit in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 10 Jun 2010, 7:44 AM
  5. How to implement behaviour of checked box tree panel
    By rojar in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 5 Aug 2008, 6:08 AM

Posting Permissions

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