Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP sample source code #16

Open
merdj opened this issue Apr 25, 2015 · 5 comments
Open

PHP sample source code #16

merdj opened this issue Apr 25, 2015 · 5 comments

Comments

@merdj
Copy link

merdj commented Apr 25, 2015

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

@lambdamusic
Copy link

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
Copy link

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

@raghukotha
Copy link

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

@robross0606
Copy link

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

@pipiscrew
Copy link

pipiscrew commented Jul 30, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants