Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi I want to bind easyui treegrid. I hava following data

SQL
id  name                 parent
1   C                    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"
			}]
		}]
	}
	}]
}]
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900