EasyUI Forum
May 16, 2024, 10:16:03 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Treegrid Dynamic load  (Read 6499 times)
zolotoy
Jr. Member
**
Posts: 89


View Profile Email
« on: July 28, 2015, 06:12:28 AM »

I am looking into the following example:
http://www.jeasyui.com/tutorial/tree/treegrid3_demo.html

and cannot understand how does it know to go a get children when a node is expanded?

Thanks
Logged
yamilbracho
Jr. Member
**
Posts: 64


View Profile Email
« Reply #1 on: July 28, 2015, 08:12:08 AM »

When you click in a node, an ajax call is made and your server side code receives the node id.
In the php code you can see a sql select where parentId is the received id.
You have to build your table with thsi structure:

id, int
parentId, int     
...

ParentId = 0 for nodes whose parent is the root of the tree.

HTH,
Yamil
Logged
zolotoy
Jr. Member
**
Posts: 89


View Profile Email
« Reply #2 on: July 28, 2015, 08:17:20 AM »

I think it's much more than that. It will go to the server if you have loader specified:
loader:function(param,success,error){
.....
}
Or url property.

If you populate data by other means it wont happen. Can't say it is extremely intuitive.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!