I've put your patch in my Mif.Tree.Node file ...
When I refresh an opened node it collapse it and refresh ... It should keep the current state and refresh !
All fields labelled (Required) must be completed before the form is submitted.
You are not logged in. Please login or register.
Mifjs forum — Mif.Tree, Mif.Menu » Help » Reload JSON branch on demand ? » Post new reply
All fields labelled (Required) must be completed before the form is submitted.
I've put your patch in my Mif.Tree.Node file ...
When I refresh an opened node it collapse it and refresh ... It should keep the current state and refresh !
better fix:
if(this.loadable && !this.state.loaded) {
var load=function(){
this.toggle();
this.removeEvent('load', load);
}.bind(this);
this.addEvent('load',load);
this.load();
return;
} Mif.Tree.Node.implement({
refreshChildren: function() {
this.state.loaded=false;
this.state.open=false;
this.state.loadable=true;
this.children=[];
this.$draw=false;
this.tree.$getIndex();
this.getDOM('children').innerHTML='';
Mif.Tree.Draw.update(this);
return this;
}
});i'm use trunk version and found bug in Mif.Tree.Node::toggle when load event addes many times if u reload node children, fix:
if(this.loadable && !this.state.loaded) {
if(!this.load_event){
this.load_event=true;
this.addEvent('load',function(){
this.toggle();
}.bind(this));
}
this.load();
return;
}I've try to extend Node Object but it doesn't works for me ?
How can I do this ?
----
Mif.Tree.Node.implement({
refreshChildren: function() {
this.state.loaded=false;
this.children=[];
Mif.Tree.Draw.update(this);
}
});
try set node state loaded to false and node children to empty array, update node and load again:
node.state.loaded=false;
node.children=[];
Tree.Draw.update(node);i'm think it's will work. If there is some problems i'm create small example.
Hello,
I use Mif Tree with Zend Framework / Php5 and Ldap directory.
When I initialize the tree, I feel it with just one level of my Ldap directory.
Clicking on each node tree loads children nodes on demand
All of this works perfeclty.
The problem is that I append thing to the Ldap directory and I need a way to refresh/reload
a particular node with all his inherited children.
How can I achieve this ?
tree = new Mif.Tree({
container: $('mytree'),
grid: true,
sortable: false,
height: 18,
forest: true,
checkbox: true,
initialize: function(){
},
types: {
dhcpGroup:{
openIcon: 'mif-tree-open-icon',
closeIcon: 'mif-tree-close-icon',
middleIcon: 'mif-tree-middle-icon'
},
dhcpHost: {
openIcon: 'mif-tree-open-icon',
closeIcon: 'mif-tree-close-icon',
middleIcon: 'mif-tree-middle-icon'
},
loader:{
openIcon: 'mif-tree-loader-open-icon',
closeIcon: 'mif-tree-loader-close-icon',
DDnotAllowed: ['inside','after']
},
},
dfltType:'folder'
});
tree.load({
url: '/catv/customer/treejson'
});
tree.loadOptions=function(node){
if(!node) return;
if(node.name=='empty'){
return {
url: '/share/empty.json'
}
}
return {
url: '/catv/customer/treejson/dn/'+node.data.dn+'?search='+ $('keywords').value
}
};
Regards
Mifjs forum — Mif.Tree, Mif.Menu » Help » Reload JSON branch on demand ? » Post new reply
Powered by PunBB