Shekhar Dalvi

Shekhar Dalvi

  • NA
  • 129
  • 10.9k

How to return data from web method to fill treegrid

Dec 1 2014 1:48 AM
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)