<?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 - Toggle Tree Features]]></title>
	<link rel="self" href="http://www.mifjs.net/forum/feed/atom/topic/223/"/>
	<updated>2010-07-25T12:46:07Z</updated>
	<generator>PunBB</generator>
	<id>http://mifjs.net/forum/topic/223/</id>
		<entry>
			<title type="html"><![CDATA[Re: Toggle Tree Features]]></title>
			<link rel="alternate" href="http://mifjs.net/forum/post/825/#p825"/>
			<content type="html"><![CDATA[[code]
tree.drag.detach();
tree.drag.attach();
[/code]]]></content>
			<author>
				<name><![CDATA[moro]]></name>
				<email><![CDATA[creavenmoro@gmail.com]]></email>
				<uri>http://mifjs.net/forum/user/2/</uri>
			</author>
			<updated>2010-07-25T12:46:07Z</updated>
			<id>http://mifjs.net/forum/post/825/#p825</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Toggle Tree Features]]></title>
			<link rel="alternate" href="http://mifjs.net/forum/post/824/#p824"/>
			<content type="html"><![CDATA[If anyone else needs it, I built this solution to toggle dragable:
[code]
            Mif.Tree.SCMDrag = new Class({
                Extends: Mif.Tree.Drag, 
                start: function(event){
                    if(this.tree.options.dragable)
                        this.parent(event);
                }
            });
[/code]

So on initialisation of the tree you have to use this:
[code]
            var instance = new Mif.Tree({
                initialize: function(){
                                    new Mif.Tree.SCMDrag( this, {preventDefault: true});
                    ...
                }, 
                    ...
                dragable: false
            }); 
[/code]
... and can turn dragable on and off by calling: 
[code]
instance.options.dragable = true; //On
instance.options.dragable = false; //Off
[/code]]]></content>
			<author>
				<name><![CDATA[theWeird]]></name>
				<uri>http://mifjs.net/forum/user/85/</uri>
			</author>
			<updated>2010-07-25T12:32:27Z</updated>
			<id>http://mifjs.net/forum/post/824/#p824</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Toggle Tree Features]]></title>
			<link rel="alternate" href="http://mifjs.net/forum/post/823/#p823"/>
			<content type="html"><![CDATA[Thank you. 
This works ;)

Do you also know a solution to toggle Drag?]]></content>
			<author>
				<name><![CDATA[theWeird]]></name>
				<uri>http://mifjs.net/forum/user/85/</uri>
			</author>
			<updated>2010-07-25T11:13:34Z</updated>
			<id>http://mifjs.net/forum/post/823/#p823</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Toggle Tree Features]]></title>
			<link rel="alternate" href="http://mifjs.net/forum/post/822/#p822"/>
			<content type="html"><![CDATA[you can change Mif.Tree.Node::sort
[code]
sort: function(sortFunction){
    if(this.tree.sortable) this.children.sort(sortFunction||this.tree.sortFunction);
    return this;
}
[/code]
and after set tree.sortable=true/false]]></content>
			<author>
				<name><![CDATA[moro]]></name>
				<email><![CDATA[creavenmoro@gmail.com]]></email>
				<uri>http://mifjs.net/forum/user/2/</uri>
			</author>
			<updated>2010-07-24T17:14:54Z</updated>
			<id>http://mifjs.net/forum/post/822/#p822</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Toggle Tree Features]]></title>
			<link rel="alternate" href="http://mifjs.net/forum/post/821/#p821"/>
			<content type="html"><![CDATA[Hey there
I've got a problem with the initialisation of advanced features like Sortable.
Is it a Must to initialize and activate these features on Tree initialisation?
There is a request for an application I am working on at the moment to toggle the Sortable function of the tree.
Per default sorting shold be off, users can click a button to turn sorting on and off again.
Is it possible to initiate sorting after the tree has been built?
Or - if not - is it possible to disable the initiated sorting functions to enable it later?

Regards, Michael]]></content>
			<author>
				<name><![CDATA[theWeird]]></name>
				<uri>http://mifjs.net/forum/user/85/</uri>
			</author>
			<updated>2010-07-24T14:25:54Z</updated>
			<id>http://mifjs.net/forum/post/821/#p821</id>
		</entry>
</feed>

