Where are you from ?!
Russia
You are not logged in. Please login or register.
Mifjs forum — Mif.Tree, Mif.Menu » Help » toggle Nodes » Post new reply
All fields labelled (Required) must be completed before the form is submitted.
Where are you from ?!
Russia
ah yes !! Thanks all is ok now !
(The alert of new post on this forum by mail is now ok too ...)
One last question (for the moment !;) Where are you from ?! ![]()
Thanks for all
yes, i'm received.
problem is varible tree not a Mif.Tree instance, but function.
replace
tree = new Mif.Tree({
...
})
.load({
...
})
.loadOptions=function(node){
if(node.data != undefined){
return {
url : 'modules/geographie3/lieux.ajax.php?ajax=treeChild',
method : 'post',
data : {'id': node.data.id}
};
}
};//<---- functionwith
tree = new Mif.Tree({
...
})
.load({
...
});
tree.loadOptions=function(node){
if(node.data != undefined){
return {
url : 'modules/geographie3/lieux.ajax.php?ajax=treeChild',
method : 'post',
data : {'id': node.data.id}
};
}
};That was post yesterday by mail. Have you received it ?
Have you received it ?
no, send to magmoro@mail.ru or creavenmoro@gmail.com
P.S. i'm fix e-mail form. It should send mail now.
I send your an accound by email form.
Have you received it ?
don't know where problem, mb u have test page?
YES ! That's work fine ! Thanks for your help !
I begin to anderstand better your work ...
But can I go too far with an other question ?? ![]()
I have make this plugin :
Mif.Tree.implement({
getNodesOrder: function(){
var node=this.forest ? this.root.getFirst() : this.root;
var saveString = '';
saveString += node.data.id + "-0,";
node=node.getNextVisible();
do{
saveString += node.data.id + "-" + node.getParent().data.id + ",";
}while(node=node.getNextVisible());
return saveString;
}
});And I try to use it like this :
initialize: function(){
new Mif.Tree.Drag(this, {
onComplete: function(){
alert(tree.getNodesOrder());
}
});
}The plugin is well loaded but firebug say :
tree.getNodesOrder is not a function
[Break on this error] alert(this.getNodesOrder());
That work fine with the old version of MifTree but not with the SVN version.
how can I find the ref of the node?
u can use same recursive function:
var someNode;
this.root.recursive(function(){
if(this.isRoot()) return;
if(this.data.id=='123') {
someNode=this;
return false;
}
});Thanks Moro ! You're right ! if(this.isLoaded()) seem to be good.
But I don't know how to find a node with his data. In my exemple, the nodes have data like : node.data.id
If I have the id that I want to select, how can I find the ref of the node to give in param at
yourTree.select(param)?
That I want is to toggle all the nodes already loaded ! Is it possible ?
mb add isLoaded check? :-)
this.root.recursive(function(){
if(this.isRoot()) return;
if(this.isLoaded()) this.toggle();
});is it possible to force the selection of one element once the tree is reloaded ?
u want just select some node?
yourTree.select(someNode)And an other question (thanks!), is it possible to force the selection of one element once the tree is reloaded ?
For exemple, after having toggled all the elements, I whant to place the selector on the element with node.data.id = 123
ok, thanks for your answer !!
But I've got an other problem now ...
With your method, when tree is toggled, all subnodes are loaded with ajax. That I want is to toggle all the nodes already loaded ! Is it possible ?
use
this.toggle();// or this.toggle(true)instead
this.toggle(null, false);it's demo mistake
If u want expand tree with forest=true try:
.addEvent('onLoad', function(){
this.root.recursive(function(){
if(this.isRoot()) return;
this.toggle();
});
})because u use forest=true, root node not exist
Mifjs forum — Mif.Tree, Mif.Menu » Help » toggle Nodes » Post new reply
Powered by PunBB