bootstrap-gtreetable
bootstrap-gtreetable copied to clipboard
PHP sample source code
Hello,
your treetable is very nice, but the sample you provided which is downloadable is not enough due to the absence of the PHP file or on how to load it from JSON.
can you help by provided the files?
thank you so much
plus 1 for a better example
I've tried adding an ajax method that returns this JSON, but still I see nothing on the page
{
"level": "1",
"type": "type",
"id": "1",
"name": "name"
}
I kind of worked it out actually. The JSON needs to be like this:
{"nodes":
[
{"id":4070,"name":"123.","level":0,"type":"default"},
{"id":4100,"name":"asd","level":0,"type":"default"}
]
}
The online demo for example works against this API: http://gtreetable2.gilek.net/index.php?r=site%2FnodeChildren&id=0
That's for level 0. Then subsequent calls need to pass an object ID, eg http://gtreetable2.gilek.net/index.php?r=site%2FnodeChildren&id=4092
Basically, you need to pass integers to both ID and Level fields. If you try to pass strings it will fail.
Agreed, the example and documentation is really bad. Almost impossible to determine how this is actually used. What is the "template"?
guys the example, using Yii2 extension aka https://github.com/gilek/yii2-gtreetable
@gilek I made a test, without yii2 ;)
rename .pdf to .zip
dont know why, couldnt uploaded as .zip