<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Mifjs forum — Mif.Tree, Mif.Menu - delete tree]]></title>
	<link rel="self" href="http://www.mifjs.net/forum/feed/atom/topic/15/"/>
	<updated>2010-07-10T16:55:37Z</updated>
	<generator>PunBB</generator>
	<id>http://mifjs.net/forum/topic/15/</id>
		<entry>
			<title type="html"><![CDATA[Re: delete tree]]></title>
			<link rel="alternate" href="http://mifjs.net/forum/post/812/#p812"/>
			<content type="html"><![CDATA[I have modified your code because of an error :
Uncaught TypeError: Cannot call method 'indexOf' of null : line 1 (surely on this.$index == null)

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

Thanks for the help!]]></content>
			<author>
				<name><![CDATA[ordiman85]]></name>
				<uri>http://mifjs.net/forum/user/146/</uri>
			</author>
			<updated>2010-07-10T16:55:37Z</updated>
			<id>http://mifjs.net/forum/post/812/#p812</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: delete tree]]></title>
			<link rel="alternate" href="http://mifjs.net/forum/post/72/#p72"/>
			<content type="html"><![CDATA[Thank you moro, that works great :)

PS: Sorry for the late feedback...]]></content>
			<author>
				<name><![CDATA[Peter]]></name>
				<uri>http://mifjs.net/forum/user/5/</uri>
			</author>
			<updated>2008-07-24T08:22:46Z</updated>
			<id>http://mifjs.net/forum/post/72/#p72</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: delete tree]]></title>
			<link rel="alternate" href="http://mifjs.net/forum/post/69/#p69"/>
			<content type="html"><![CDATA[[code]Mif.Tree.implement({
    
    del: function(){
        this.UID=0;
        this.$={};
        this.$index=null;
        this.mouse.node=false;
        this.unselect();
        this.wrapper.innerHTML='';
    }
    
});[/code]]]></content>
			<author>
				<name><![CDATA[moro]]></name>
				<email><![CDATA[creavenmoro@gmail.com]]></email>
				<uri>http://mifjs.net/forum/user/2/</uri>
			</author>
			<updated>2008-07-06T05:58:05Z</updated>
			<id>http://mifjs.net/forum/post/69/#p69</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[delete tree]]></title>
			<link rel="alternate" href="http://mifjs.net/forum/post/60/#p60"/>
			<content type="html"><![CDATA[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]]></content>
			<author>
				<name><![CDATA[Peter]]></name>
				<uri>http://mifjs.net/forum/user/5/</uri>
			</author>
			<updated>2008-07-01T16:06:56Z</updated>
			<id>http://mifjs.net/forum/post/60/#p60</id>
		</entry>
</feed>

