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've a different file with class so there was a problem, thank you very much.

2

this reload tree demo works for me in ie6

archive

Mif.Tree.implement({
    
    del: function(){
        this.$index=null;
        this.mouse.node=false;
        this.unselect();
        this.forest ? this.wrapper.getElement('.mif-tree-children-root').destroy() : this.root.getDOM('node').destroy();
    },
    
    reload: function(options){
        this.del();
        this.load(options);
    }
    
});
window.addEvent('domready', function(){
    tree = new Mif.Tree({
        initialize: function(){
            new Mif.Tree.Drag(this);
        },
        container: $('tree_container'),// tree container
        types: {// node types
            folder:{
                openIcon: 'mif-tree-open-icon',//css class open icon
                closeIcon: 'mif-tree-close-icon'// css class close icon
            }
        },
        dfltType:'folder',//default node type
        height: 18//node height
    });

    var json=[
        {
            "property": {
                "name": "root",
                "dragDisabled": true//root drag disabled!
            },
            "children": [
                {
                    "property": {
                        "name": "node1"
                    }
                },
                {
                    "property": {
                        "name": "node2"
                    },
                    "state": {
                        "open": true
                    },
                    "children":[
                        {
                            "property": {
                                "name": "node2.1"
                            }
                        },
                        {
                            "property": {
                                "name": "node2.2"
                            }
                        }
                    ]
                },
                {
                    "property": {
                        "name": "node4"
                    }
                },
                {
                    "property": {
                        "name": "node3"
                    }
                }
            ]
        }
    ];
    
    
    // load tree from json.
    tree.load({
        json: json
    });
    
    //tree.root.toggle(true);
    
    $('reload').addEvent('click' ,function(){
        tree.reload({url: 'new.php?prevent_cache='+$time()});
    });
});
<?
echo '[
    {
        "property": {
            "name": "'.microtime().'",
            "dragDisabled": true
        },
        "children": [
            {
                "property": {
                    "name": "Qnode1"
                }
            }
        ]
    }
]';
?>

3

Hi, thanks for reply, when added new param time() in IE6 everything in window with three disappeared. IN IE7 refresh but with old value so - in practice don't refresh.:/

4

don't know what happened with ie6, need tests. For ie7, may be ie7 caches requests, try add some variable to prevent caching:

tree.reload({
    url: 'menuorder/data.php?json=yesplease<? echo "&l=".$_GET['l'];?>'&prevent_cache=$time()
});

5

Hello, I have a problem with IE6 and IE7. I have a code:

var request = function(e) {
                new Event(e).stop();

                var theDump = tree.serialize();
                var req = new Request({
                        method: 'post',                
                        url: "menuorder/save.php<? echo "?l=".$_GET['l'];?>", 
                        /*onSuccess:     function(html) {
                            $('debug').empty().set('text',html);
                        },*/
                        onComplete: function() {
                            tree.reload({
                                url: 'menuorder/data.php?json=yesplease<? echo "&l=".$_GET['l'];?>'
                            });
                        }
                }).send('m='+JSON.encode(theDump));
            };
            $('save').addEvent('click', request);

function reload was implemented in tree class:

 reload: function(options){
        var tree=this;
        this.del();
        this.load(options);

In FF everything is ok, but in IE 6 when click on "save" everything in window with tree is dissapearing, in IE7 tree is reloading but in old sort order. Please help with this.

Best regards
Paul