Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
230
Binding Nested object in IgGrid
posted

Hi,

I need to bind the below json format data in IgGrid. Please let me know how to do it. 

<script>
var products = [];
products[0] = { "ProductID": 1, "ProductDetail": { "ProductName": "ABC", "ProductNumber": "ABC001" };
</script>

<table id=”grid1”></table>

<script>
$(function () {
$("#grid1").igGrid({
columns: [
{ headerText: "Product ID", key: "ProductID", dataType: "number" },
{ headerText: "Product Name", key: "ProductName", template: "${ProductDetail.ProductName}" },
{ headerText: "Product Number", key: "ProductNumber", template: "${ProductDetail.ProductNumber}" },
],
width: '500px',
dataSource: products
});
});
</script>