1

(0 replies, posted in Help)

Hello,

How can I expand all ajax tree ?
I've tried with

    this.root.recursive(function(){
                       if(this.isRoot()) return;
                    this.toggle(true);
                });

and

                tree.addEvent('loadNode', function(node){
                    node.getChildren().each(function(child){
                        child.toggle();
                       });
                  });
                

the last one works as expected but how can I remove loadNode event when  all tree  finish to expand ?

I've add onFocus event to tree  and seems that has partially solve the issue

onFocus: function() {
   window.focus()

Hello,

Mif.Tree key events are not fired  when tree is embedded into iframe.

Navkey won't work properly and  tree.key is empty on drag events.

Any ideas of what occurs ?
I'm running firefox 3.6.8 on Mac

I've attached a minimal test case  and you can take look online here
http://www.eomplus.net/test

4

(1 replies, posted in Help)

Hello,

I've tried to add an item with own submenu using add method but seems that add method doesn't handle submenu...

I need more or less the same thing as load method but with the posibility to  inject data anywhere : before, after, top, bottom on an item.


var newItem = new Mif.Menu.Item({'menu':this}, {'name' : 'sort by', 'submenu':  
                                [ {'options': 
                                     {'onAction': function(item) { 
                                        var selected = tree.selected;
                                        if(selected){
                                            selected.data.sort = item.property.name;
                                            selected.refreshChildren();
                                        }
                                     } 
                                      }
                                 }].concat(selected.property.sortMenu)
                             });

                             this.add(newItem, Mif.id('refresh'), 'after');

5

(2 replies, posted in Help)

Hi,

Any chance to have a feature to handle huge tree drawing ...  ¿ A paging ?

Thank you

6

(2 replies, posted in Help)

Hello,

How can I optimize huge tree drawing ? I've got tree branches with more than 2000 nodes loaded using JSON.
I've cached the JSON string on server side but what can I do on client side ... 

During drawing no loading cursor neither icon appear on the branch. The computation take  a very long time ( >  10s ), browser becomes very slow and looks like doesn't answer.

Thank you

7

(1 replies, posted in Feature requests)

I've tweaked a little bite  the stylesheet and Mif.Draw.js  file and it works like charm smile ...

Nice smile ... thank you Moro

I've partialy resolved the issue firing  onBeforeShow event into  show method.

10

(1 replies, posted in Bugs)

In Mif.Menu.KeyNav.js, action method throw exception if current var is null

       ...
    action: function(current){
        if(!current) return; // this line fix the issue ...
        current.menu.close(current);
    }
        ...

Hi,

I'm  unable to get the current event object whent events fired.
I mean that for example when  'show' event is fired  event object passed as argument.

In my case  I use event delegation and I need this to be able to open correct menu.

In Mif.Menu.js file on line 66 to do the job I've replaced :

return this.fireEvent('show');

by

return this.fireEvent('show', [ coords.event ]);



Thank you

Hello,

In the old  Mif.Menu I used  onShow to create dynamic menu on the fly.

With the code below It doesn't works :

        contextMenu = new Mif.Menu({
            onShow: function(e) {
                    var widget, target = e.target;

                        if  (widget.getContextMenu) {
                                                     // getContextMenu method return json structure compatible with Mif.menu
                                                     this.load( widget.getContextMenu() );
                        }
                    }
                }        
        
            }).attach('pageWrapper').load([
                {
                    name: 'test'
                }
            ])

Note that   If menu is empty 'show' event is never called and load method call into onShow trigger
don't do nothing because menu is already loaded.

What is the solution to achieve this ?

I've created another post related indirectly to this issue bease show event doesn't send context event when fired :

http://mifjs.net/forum/topic/203/

Thank you

Hello,

It would be nice to have a Mif.menu only drawed using CSS new attributes  for shadow, round corners, ...

Take a look to this resource for shadow
http://markusstange.wordpress.com/2009/ … x-shadows/

And these lines do the job for all new modern browser :
  -moz-border-radius: 5px;
  -webkit-border-radius: 5px;
  border-radius: 5px;

Thank you

14

(2 replies, posted in Help)

What occurs is that take a long time to init everything ...
I've got 3 treeview with php JSON datas to fillup each and much more javascript to handle everything I need.

It would be nice to have some mechanism to lock the tree meanwhile is not totaly ready.

15

(2 replies, posted in Help)

how can I  key into dndCustomAction ?

I would like to handle  alt/ctrl in dndCustomAction method to be able to copy or move in some particular case.
I've tried "this.key" but doesn't works.

Thank you

What is the solution to remove  the gap ? Because In the CSS  I've seend 18px left padding  but If I remove it checkboxes are hidden in all cases ...

17

(2 replies, posted in Help)

I use   onCopy action to solve my issue ...

18

(2 replies, posted in Help)

Considering 2 trees. One without checkboxes and the other with checkboxes.
I want to copy node from the first tree to the second and tick the checkbox.  Unfortunately when I try to
do it doesn't works ...

Seems that copy method returns always reference from the original tree...
I've setup the custom dnd action on the destination tree ...


                Mif.Tree.implement({
                
                    dndCustomAction: function(current, target, where){
                        if(current.tree==target.tree){
                            current.tree.move(current, target, where);
                        }else{
                            var tree = current.tree.copy(current, target, where);
                            tree.getSelected().switch(true);
                        }
                    }
                });
----- 

tree1 = new Mif.Tree({
                        ...                
                        initialize: function(){
                              ...
                              new Mif.Tree.Drag(this, {
...     
                     
tree2 = new Mif.Tree({
                        ...                
                        initialize: function(){
                                ...
                               this.initCheckbox('deps');
                               new Mif.Tree.Drag(this, {
                                action:'dndCustomAction',
                                                                ...

Hello,

I've got 2 trees on the same page. I've setup Cookie storage on both (inside of the initialize method).
Both have ID for each nodes. 

When you reload the page seems that cookie storage is restore only for one of the tree. The last
which you have interacted with.

20

(1 replies, posted in Help)

How can I totaly disable node (gray color and no user interaction) ?
Does it possible to do it in cascade with children  like with checkboxes ?

21

(1 replies, posted in Help)

Hello,

how can I extend checkbox support to add more states ?

Hello,

I've play with tree.add method.
My issue is that tree.add select automatically the inserted node...

I think that is not very practicle. In my case I've a button to add "node"  each time I click  node is created into
the last created instead as a child of the initial selected node.

23

(15 replies, posted in Help)

thank you Moro.
seems that works now !  what was the problem ?
your code is quite same as mine ...

24

(15 replies, posted in Help)

I've just send you an email to your gmail a testcase ... take a look and you will see that cookie storage + refresh children at the same time doesn't do the job properly.

25

(15 replies, posted in Help)

cookie storage still doesn't works properly with on demand json and refresh children ...

refreshChildren: function() {

            var opened = this.isOpen();
            
            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);

            var data=this.tree.storage.read();

            this.tree.addEvent('loadChildren', function(){
                this.tree.storage.restore(data);
            }.bind(this));

            if (opened) {
                this.toggle();
            }
        
            return this;

               },    

You tell me in on of your post to remove ID's ... How can I do this ?
Note that all of my nodes have unique IDs.  I generate and md5  from  LDAP DN (equivalent DB primary key).

The bug is not easy to reproduce ...
For example if  I open various sub nodes on the same level  and I refresh the parent ... only 1 ore 2 subnodes are partially restored ...