bootstrap-gtreetable icon indicating copy to clipboard operation
bootstrap-gtreetable copied to clipboard

PHP sample source code

Open merdj opened this issue 9 years ago • 5 comments

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

merdj avatar Apr 25 '15 07:04 merdj

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"
}

lambdamusic avatar Aug 10 '15 16:08 lambdamusic

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

lambdamusic avatar Aug 10 '15 16:08 lambdamusic

Basically, you need to pass integers to both ID and Level fields. If you try to pass strings it will fail.

raghukotha avatar Sep 08 '15 20:09 raghukotha

Agreed, the example and documentation is really bad. Almost impossible to determine how this is actually used. What is the "template"?

robross0606 avatar Sep 15 '15 03:09 robross0606

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

noyii2.pdf

pipiscrew avatar Jul 30 '16 21:07 pipiscrew