We considered the requirement “EditTemplate write function is always Maintained the original value ” as a bug. We have logged a report on this and will fix the issue internally, also the fix will be included in Vol 2 Service Pack release which has been scheduled to be rolled out in the month of July 2015.
We have also created an incident internally to have a follow up with this issue.
We suggest you to use the below workaround solution to resolve your reported issue. Please refer the sample and code snippet below:
Sample: Grid
$("#grid").ejGrid({ dataSource: data,
editSettings: { allowEditing: true, editMode: "batch" }, toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel] },
columns: [ { field: "text", isPrimaryKey: true, headerText: "Text", width: 80 }, { field: "yesNo", headerText: "Yes/No", editTemplate: { create: function () { return "<input type='checkbox' class='trimmaGridCheckBox' />"; }, read: function (args) { // Read checkbox state. return args.prop("checked"); }, write: function (args) { // Set checkbox state from row data. obj = $("#grid").ejGrid('instance'); val = obj._bulkEditCellDetails.cellValue; args.element.prop("checked", val !== undefined ? val : args.rowdata["yesNo"]); } } } ] |