Topic: No ajax load

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

Re: No ajax load

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;
?>