1
Reply

How to return data from web method to fill treegrid

Ask a question
Hi I want to bind easyui treegrid. I hava following data
 
 id name parent
 1 NULL
 2 Program Files 1
 3 Windows 1
 4 Microsoft Sql Server 2
 5 Microsoft .Net 3
 
 how can I return a string in the following format from web method
 
[{ 	"id":1, 	"name":"C", 	"children":[{ 		"id":2, 		"name":"Program Files", 		"children":[{ 			"id":4, 			"name":"Microsoft Sql Server", 			}] 		},{ 			"id":3, 			"name":"WINDOWS", 			"children":[{ 				"id":5, 				"name":"Microsoft .Net" 			}] 		}] 	} 	}] }]
 

Answers (1)