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 have modified your code because of an error :
Uncaught TypeError: Cannot call method 'indexOf' of null : line 1 (surely on this.$index == null)

Mif.Tree.implement({
    del: function()
    {
        this.UID = 0;
        this.$ = {};
        this.$index = []; // Array, not null
        this.mouse.node = false;
        this.unselect();
        this.wrapper.innerHTML = '';
    }
});

Thanks for the help!

2

Thank you moro, that works great smile

PS: Sorry for the late feedback...

3

Mif.Tree.implement({
    
    del: function(){
        this.UID=0;
        this.$={};
        this.$index=null;
        this.mouse.node=false;
        this.unselect();
        this.wrapper.innerHTML='';
    }
    
});

4

Hi Moro,

How do you delete the content of a tree? (or subtree)

I have a Mif.Tree object which I populated using load(json...). But I would like to clear it to re-populate it with new data. If I call load twice, the new data is appended to the previous one.

Cheers,
Peter