I haven't tried it myself so I also don't know, however, studying sources is always the best way to find out answers.
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
/*
* 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] ....
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
Hi Saki,
You may want to take a look at this:
It should solve the problem of too much recursion with cascadeCheck: 'all' and bubbleCheck: 'all' setting (also with other combinations).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
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
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
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
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
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
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:
The issues I've got are: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' }
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.