Title: Node tree php Post by: kavvson on September 30, 2014, 12:22:00 PM I use
Code: SELECT * FROM customers example output Code: [{"id": 1,"name": "Marcin","surname": "A"}, {"id": 2,"name": "Piotr","surname": "B"}, {"id": 3,"name": "Kamil","surname": "C"}] and the customers could have a child [ but doesn't have to ] My query Code: select listy.number,listy.id,listy.created,listy.type from listy where forwho = $id example ouput Code: [{"number": "122232222222222222222222","id": 1,"created": "2014-09-12 14:51:00","type": 1}, {"number": "412333333333333333333333","id": 2,"created": "2014-09-03 15:15:00","type": 1}, {"number": "423233333333333333333333","id": 3,"created": "2014-09-03 16:08:00","type": 1}] What Iam willing to get is, [root] - [Marcin A] = 122232222222222222222222 = 412333333333333333333333 = 423233333333333333333333 - [Piotr B] = No entries [/root] I was basing on the example on : http://www.jeasyui.com/tutorial/tree/tree2.php but I can not achieve this somehow. All I need is to load data onclick on the [Name] cause the child can have ~100 entries My php code Code: $result = array(); generated : Code: [{"id":"1","text":"Marcin B","state":"open"}......... It doesn't displays in the tree even, I use Code: <ul id="tt" class="easyui-tree" and everything is properly directed and included for sure cause on a static .json file from other examples it shows up. It might be wrong with my code maybe. Thanks for help Title: Re: Node tree php Post by: stworthy on October 01, 2014, 02:48:36 AM Please refer the code below:
Code: <ul id="tt" class="easyui-tree" url="test.php"> Code: <?php Title: Re: Node tree php Post by: kavvson on October 01, 2014, 04:05:29 AM Well done, does the formater allows to do a <a href="...?=number">number</a>? how can I accomplish it ( only for child ) there is only 1 level of each root
Title: Re: Node tree php Post by: stworthy on October 01, 2014, 05:54:59 AM Yes, the 'formatter' function can be used to format the node text. Please refer to the code below:
Code: <ul id="tt" class="easyui-tree" data-options=" |