Skip to forum content
Mif
— mystic javascript interface
You are not logged in. Please login or register.
Active topics Unanswered topics
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.
Topic review (newest first)
I have find 
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;
?>
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