Hi,
I am trying to work on formula. Why case 1 is working, but case 2 is not working? Am I implementing it incorrectly?
case 1:
case 2:
Regards,
Ryan
I am trying to work on formula. Why case 1 is working, but case 2 is not working? Am I implementing it incorrectly?
case 1:
Code:
isc.RestDataSource.create({ ID: "DS1", clientOnly: true, fields: [ { name: "Item", type: "text" }, { name: "Quantity", type: "integer" }, { name: "UnitPrice", type: "float" }, { name: "TotalAmount", type: "float" } ], cacheData: [ { Item: "Item A", Quantity: 1, UnitPrice: 1.45, TotalAmount: 1.0 }, { Item: "Item B", Quantity: 2, UnitPrice: 2.2, TotalAmount: 4.0 }, { Item: "Item C", Quantity: 3, UnitPrice: 1.9, TotalAmount: 3 } ] }); isc.ListGrid.create({ ID: "Grid", height: 400, width: 400, dataSource: "DS1", canEdit: true, autoSaveEdits: false, modalEditing: true, autoFetchData: true, fields: [ { name: "Item", type: "text" }, { name: "Quantity", type: "integer" }, { name: "UnitPrice", type: "float", format: "#.#0", editorFormula: { text: "toFixed(UnitPrice, 2)" } }, { name: "TotalAmount", type: "text", editorFormula: { text: "toFixed(UnitPrice * Quantity, 2)" } } ] }); isc.VLayout.create({ ID: "Layout", height: "100%", width: "100%", autoDraw: true, members: ["Grid"] });
Code:
isc.RestDataSource.create({ ID: "DS1", clientOnly: true, fields: [ { name: "Item", type: "text" }, { name: "Quantity", type: "integer" }, { name: "UnitPrice", type: "float" }, { name: "TotalAmount", type: "float" } ], cacheData: [ { Item: "Item A", Quantity: 1, UnitPrice: 1.45, TotalAmount: 1.0 }, { Item: "Item B", Quantity: 2, UnitPrice: 2.2, TotalAmount: 4.0 }, { Item: "Item C", Quantity: 3, UnitPrice: 1.9, TotalAmount: 3 } ] }); isc.ListGrid.create({ ID: "Grid", height: 400, width: 400, dataSource: "DS1", canEdit: true, autoSaveEdits: false, modalEditing: true, autoFetchData: true, fields: [ { name: "Item", type: "text" }, { name: "Quantity", type: "integer" }, { name: "UnitPrice", type: "float", format: "#.#0" }, { name: "TotalAmount", type: "text", editorFormula: { text: "toFixed(UnitPrice * Quantity, 2)" } } ] }); isc.VLayout.create({ ID: "Layout", height: "100%", width: "100%", autoDraw: true, members: ["Grid"] });
Ryan
Comment