I want JSON binding to bind hierarchicalGrid. I’m getting data like below from Ajax Call. ProductId is the relation between them. My parents row need to be
Product and child row will be ProductDetails
var Product = [
{ProductId:1 , Name: "Food", Company: "Food"},
{ProductId:2 , Name: "Food1", Company: "Food1}]
var ProductDetails =[
{ProductId:1 , color: ”Red” ,Quantity :”1”},
{ProductId:1 , color: ”Balack” ,Quantity :”1”},
{ProductId:2 , color: ”Red” ,Quantity :”1”}
{ProductId:2 , color: ”Balack” ,Quantity :”1”}]
How I can bind this type of structure at client side using java script?
Thanks!
Manish
Hello Manish,
It is not possible to display the data in this format. You should reformat it in hierarchical JSON - the child records should be properties of the parent object. For example:
{ ProductId: 1, Name: "Food", Company: "Food1", Items: [
{Color: "Red", Quantity: 1},
{Color: "Black", Quantity: 5}
]}
Please let me know if you have any further questions.
Hi,
I'm just checking if you have any further questions on the matter.