Results 1 to 10 of 14

Thread: Ext.ux.grid.TriStateTree

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User lfs2008's Avatar
    Join Date
    Oct 2010
    Location
    Russia
    Posts
    66

    Default Ext.ux.grid.TriStateTree

    Features:
    1. Extends Ext.tree.Panel
    2. If a parent node is checked / unchecked, all its child nodes are automatically checked / unchecked too.
    3. If only some children of a node are selected, its checkbox remains checked, but with a third visual state, using a darkened background.
      * A single file (checkboxes.gif) defines all the three images.
    4. getSelections method returns list of checked data as objects for simple backend serialization as [{id: 123}, {id: 345} ...]
      * If called with parameter id_only (bool) - it returns list of checked data as [123, 345]
      * If ALL_ID value found, only ALL_ID returned. as [{id: 1}]
      * By default only leaf nodes id`s returned. You can configure it via 'returnLeafsOnly' property.
    5. setSelections method consumes list of IDS [123,456,789] or objects [{id: 123}, {id: 345}]
      * Pass ALL_ID value in input list to check all.

      DEMO AND SOURCES http://wap7.ru/folio/ext-tri-state-tree/

      Ext.ux.grid.TriStateTree extension.png
    Please share any thoughts. if it is a duplicated extension - please comment.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409

    Default

    Nice job .. thank you for the contribution.

    Scott.

  3. #3
    Sencha User razvanioan's Avatar
    Join Date
    Feb 2008
    Location
    Romania
    Posts
    135

    Default

    Awesome man,

    This works even on ExtJS 5 !

    Thx

    Later edit:

    It seems that on the ExtJS 5 while hovering the mouse over the arrow expander, the disabledCls vanishes, and I think that's maybe they use set('cls') for that which overrides ours.....

    I was trying to use addCls to the view of the record like in the example bellow, but this has more issues because they are removed by the framework on collapse / expand of the nodes.....

    I'll keep trying to find THE solution, but I also think that this shouldn't happen and I've reported this as bug here (fiddle included).....

    PHP Code:
    isThirdState: function (node) {
          return 
    node.isThirdState;
          
    //return  node.get('cls') == this.disabledCls;
        
    },

        
    setThirdState: function (node) {    
          
    //node.set('cls', this.disabledCls);
          
    node.getOwnerTree().getView().addRowCls(nodethis.disabledCls);
          
    node.set('checked'false);
          
    node.isThirdState true;
        },

        
    unsetThirdState: function (node) {
          
    //node.set('cls', '');
          
    node.getOwnerTree().getView().removeRowCls(nodethis.disabledCls);
          
    node.isThirdState false;
        } 
    Last edited by razvanioan; 14 Sep 2014 at 9:01 AM. Reason: Small issue found although
    ---
    Razvan Ioan ANASTASESCU
    Senior WEB Developer

  4. #4
    Sencha User lfs2008's Avatar
    Join Date
    Oct 2010
    Location
    Russia
    Posts
    66

    Default

    Hi! Please keep us informed about extjs5 bug status so i can update plugin if it is not a bug

  5. #5
    Sencha User razvanioan's Avatar
    Join Date
    Feb 2008
    Location
    Romania
    Posts
    135

    Default

    It seems that indeed was a bug the will be corrected in 5.0.2.

    Here it is: http://www.sencha.com/forum/showthre...49#post1066349

    Thanks once again !
    ---
    Razvan Ioan ANASTASESCU
    Senior WEB Developer

  6. #6
    Sencha User razvanioan's Avatar
    Join Date
    Feb 2008
    Location
    Romania
    Posts
    135

    Default option

    I have a situation when I might set returnLeafsOnly to some default, but sometimes on the same tree I'd like to be able to getSelections using some other option than the one set by default with the config parameter.

    So, I've added a secondary parameter called leafs_only to getSelections method (after id_only).
    Then I've checked if it's passed it or not when the method is called, if not stick to parameter default.

    PHP Code:
    if(leafs_only == undefined){
        
    leafs_only me.returnLeafsOnly;

    and then use this variable when checking in the code bellow, instead config option directly.

    Cheers
    ---
    Razvan Ioan ANASTASESCU
    Senior WEB Developer

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
  •