Page 11 of 15 FirstFirst ... 910111213 ... LastLast
Results 101 to 110 of 150

Thread: Ext.ux.tree.CheckTreePanel

  1. #101
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    I haven't tried it myself so I also don't know, however, studying sources is always the best way to find out answers.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  2. #102
    Ext User
    Join Date
    May 2009
    Posts
    3
    Vote Rating
    0
      0  

    Default how tu use setValue

    /*
    * Set nodes checked/unchecked
    * @param {Mixed} val variable number of arguments, e.g. setValue('1,8,7', 3, [9,4])
    * @return {Array} value. Array of checked nodes
    */

    -----------------------------------
    above is the setValue 's comments, I just want to know what 's the three params mean of '1,8,7',3,[9,4] ....

  3. #103
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    It is example of all possible types. Nodes with ids 1, 8, 7, 3, 9 and 4 would be checked.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  4. #104
    Sencha User
    Join Date
    Mar 2008
    Location
    Poland
    Posts
    18
    Vote Rating
    0
      0  

    Default

    Hi Saki,

    You may want to take a look at this:

    Code:
    Index: Ext.ux.tree.CheckTreePanel.js
    ===================================================================
    --- Ext.ux.tree.CheckTreePanel.js    (revision 1937)
    +++ Ext.ux.tree.CheckTreePanel.js    (working copy)
    @@ -452,19 +452,20 @@
         // {{{
         /**
          * Called when check changes
    +     * @param {TreeNode} callerNode a node which requested the change
          * @private
          */
    -    ,onCheckChange:function() {
    +    ,onCheckChange:function(callerNode) {
             var checked = this.isChecked();
             var tree = this.node.getOwnerTree();
             var bubble = tree.bubbleCheck;
             var cascade = tree.cascadeCheck;
     
             if('all' === bubble || (checked && 'checked' === bubble) || (!checked && 'unchecked' === bubble)) {
    -            this.updateParent(checked);
    +            this.updateParent(checked, callerNode);
             }
             if('all' === cascade || (checked && 'checked' === cascade) || (!checked && 'unchecked' === cascade)) {
    -            this.updateChildren(checked);
    +            this.updateChildren(checked, callerNode);
             }
     
             tree.updateHidden();
    @@ -475,16 +476,17 @@
         /**
          * Sets node UI checked/unchecked
          * @param {Boolean} checked true to set node checked, false to uncheck
    +     * @param {TreeNode} callerNode a node which requested the change
          * @return {Boolean} checked
          */
    -    ,setChecked:function(checked) {
    +    ,setChecked:function(checked, callerNode) {
             checked = true === checked ? checked : false;
             var cb = this.cbEl || false;
             if(cb) {
                 true === checked ? cb.addClass('x-tree-node-checked') : cb.removeClass('x-tree-node-checked');
             }
             this.node.attributes.checked = checked;
    -        this.onCheckChange();
    +        this.onCheckChange(callerNode);
             return checked;
         } // eo function setChecked
         // }}}
    @@ -503,14 +505,17 @@
         /**
          * Sets parents checked/unchecked. Used if bubbleCheck is not 'none'
          * @param {Boolean} checked
    +     * @param {TreeNode} callerNode a node which requested the change
          * @private
          */
    -    ,updateParent:function(checked) {
    +    ,updateParent:function(checked, callerNode) {
    +        if(callerNode && this.node == callerNode) return;
    +        
             var p = this.node.parentNode;
             var ui = p ? p.getUI() : false;
             
             if(ui && ui.setChecked) {
    -            ui.setChecked(checked);
    +            ui.setChecked(checked, this.node);
             }
         } // eo function updateParent
         // }}}
    @@ -518,13 +523,16 @@
         /**
          * Sets children checked/unchecked. Used if cascadeCheck is not 'none'
          * @param {Boolean} checked
    +     * @param {TreeNode} callerNode a node which requested the change
          * @private
          */
    -    ,updateChildren:function(checked) {
    +    ,updateChildren:function(checked, callerNode) {
    +        if(callerNode && this.node.childNodes.indexOf(callerNode) > -1) return;
    +        
             this.node.eachChild(function(n) {
                 var ui = n.getUI();
                 if(ui && ui.setChecked) {
    -                ui.setChecked(checked);
    +                ui.setChecked(checked, this.node);
                 }
             });
         } // eo function updateChildren
    It should solve the problem of too much recursion with cascadeCheck: 'all' and bubbleCheck: 'all' setting (also with other combinations).

    As usual, I'd like thank you a lot for your work. A developer's life would be much harder without your submissions

    Regards,
    mh

  5. #105
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    Perfect! I'll take a look soon, will let you know the result.

    Thank you.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  6. #106
    Ext User
    Join Date
    Feb 2009
    Posts
    13
    Vote Rating
    0
      0  

    Default

    hi,
    how do i checkall nodes on preload?

  7. #107
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    You could iterate through nodes and set them checked. Most likely you would need to suppress events before the loop and resume them after the loop.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  8. #108
    Ext User
    Join Date
    Jul 2009
    Posts
    1
    Vote Rating
    0
      0  

    Default

    Hi,

    Is it possible to use CTP with the 2.0.1 version of ext-js? It is not possible to upgrade to any other version because the online shop (xtCommerce veyton) I have to modify uses 2.0.1.

    Sorry, if this is a noob question, but I am only for a short time with ext-js.

    Many thaks in advance

  9. #109
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    Try it - I've never tried myself.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  10. #110
    Ext JS Premium Member
    Join Date
    Feb 2009
    Posts
    487
    Vote Rating
    6
      0  

    Default

    I'm trying to use this extension in a wizard.

    So far I've managed to get the tree populated with nodes from the database but there are a couple of issues.

    Here's the set up script:

    Code:
                            xtype        : 'checktreepanel',
                            title        : 'Countries/regions',
                            id            : 'regions',
                            width:300,
                            height:250,
                            autoScroll:true,                
                            rootVisible:false,
                            root        : {
                                nodeType     : 'async',
                                id             : 'root',
                                text         : 'root',
                                expanded     : true,
                                uiProvider     : false
                            },                        
                            dataUrl : 'index.php?eID=tx_supersearch_pi1&mode=getRegions'
                            }
    The issues I've got are:
    1. Despite setting rootVsisble: false, the root node is visible.
    2. Despite setting expanded: true, the tree is not expanded.
    3. There's no check boxes visible in the tree.

    You can see the working version here: http://www.holiday-chateau.com/index.php?id=10790

    Click the Availability Search tab and go to the next step in the wizard.

    Apologies if it's a little slow - I intend to load the wizard only once the tab is selected in the final version, which should improve performance.

    Any pointers greatly appreciated.

Page 11 of 15 FirstFirst ... 910111213 ... LastLast

Posting Permissions

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