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 have find smile

getChildren.php

<?php
$children = array();

$children[] = '
    {
        "property":{
            "id":"id_toto",
            "name":"toto"
        },
        "type":"file"
    }
    ';

$children[] = '
    {
        "property":{
            "id":"id_tata",
            "name":"tata"
        },
        "type":"folder"
    }
    ';
$json = '['.join($children,',').']';
echo $json;
?>

2

The continuation of the tree is never made after click 'DSL'

tree.js

window.addEvent('domready',function(){
    tree = new Mif.Tree({
        container: $('tree_container'),
        initialize: function(){
            this.initSortable();
        },
        types: {
            folder:{
                openIcon: 'mif-tree-open-icon',
                closeIcon: 'mif-tree-close-icon',
                loadable: true
            },
            file:{
                openIcon: 'mif-tree-file-open-icon',
                closeIcon: 'mif-tree-file-close-icon'
            },
            loader:{
                openIcon: 'mif-tree-loader-open-icon',
                closeIcon: 'mif-tree-loader-close-icon',
                DDnotAllowed: ['inside','after']
            }
        },
        dfltType:'folder',//default node type
        height: 18//node height
    });

    var json=[
        {
            "property": {
                "id": "id_0",
                "name": "DSL"
            }
        }
    ];
    
    // load tree from json.
    tree.load({
        json: json
    });
    
    tree.loadOptions=function(node){
        return {
            url:'include/getChildren.php'
        };
    };
    
});

getChildren.php

<?php
$children = array();
$children[] = 
    array(
        'property' => array(
            'id' => 'id_toto',
            'name' => 'toto'
        ),
        'type' => 'file'
    );

$children[] = 
    array(
        'property' => array(
            'id' => 'id_tata',
            'name' => 'tata'
        ),
        'type' => 'folder',
    );

echo json_safe_encode($children);
?>

Thank you for help