itemTemplate.ejGrid( { dataSource: dataManager, allowSorting: true, allowPaging: true, columns: [ { field: "ID", headerText: "ID", isPrimaryKey: true, textAlign: ej.TextAlign.Right, width: 90 }, { field: "Company", headerText: 'Company', width: 90 }, { field: "Address", headerText: 'Address', width: 90 }, { field: "TaxNumber", headerText: 'Taxnumber', width: 90 }, { field: "Website", headerText: 'Website', width: 150 }, { field: "PostalNumber.PostalNr", headerText: 'Postalnumber', width: 90 }, { field: "City.Code", headerText: 'City', width: 90 } ], actionComplete: function (args) { if (args.requestType == "save") myapp.applyChanges(); }, }); { ID: 10248, Company: "VINET", Address: 5, Website: "Vins et alcools Chevalier", TaxNumber: 32.38, PostalNumber: { PostalNr: "51100" }, City: {Town:"Reims", Code:"042"}} |
for (i = 0; i < first.children.length; i++) { if (ej.isNullOrUndefined(first.children[i].valueModel.elementType)) //checking if the field is of complex type fieldname[i] = { field: first.children[i].valueModel.name, width: 100 }; else { fieldname[i] = { field: first.children[i].valueModel.name + "." + first.children[i].valueModel.elementType[":@SummaryProperty"].property.name, width: 100 };//merge the table name with the summary property of the table and assign it as fieldName } |