Skip to forum content

Mif

— mystic javascript interface

You are not logged in. Please login or register.


Post new reply

Post new reply

Compose and post your new reply

You may use: BBCode Images Smilies

All fields labelled (Required) must be completed before the form is submitted.

Required information for guests



Captcha image. Turn pictures on to see it.
Required information
Optional post settings

Topic review (newest first)

1

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 !

2

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;
        }

3

    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;
        }       

    });

demo, demo zip archive

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;
        }

4

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);
                     }               
           
            });

5

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.

6

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