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

tree.drag.detach();
tree.drag.attach();

2

If anyone else needs it, I built this solution to toggle dragable:

            Mif.Tree.SCMDrag = new Class({
                Extends: Mif.Tree.Drag, 
                start: function(event){
                    if(this.tree.options.dragable)
                        this.parent(event);
                }
            });

So on initialisation of the tree you have to use this:

            var instance = new Mif.Tree({
                initialize: function(){
                                    new Mif.Tree.SCMDrag( this, {preventDefault: true});
                    ...
                }, 
                    ...
                dragable: false
            }); 

... and can turn dragable on and off by calling:

instance.options.dragable = true; //On
instance.options.dragable = false; //Off

3

Thank you.
This works wink

Do you also know a solution to toggle Drag?

4

you can change Mif.Tree.Node::sort

sort: function(sortFunction){
    if(this.tree.sortable) this.children.sort(sortFunction||this.tree.sortFunction);
    return this;
}

and after set tree.sortable=true/false

5

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