function markOriginRow(args) {
if (!ej.isNullOrUndefined(rowIndex)) {
var gridObj = $("#FlatGrid").ejGrid("instance");
//this.selectRows(rowIndex);
//get selected row and assign Symbol value to args and reload that row only to show change. Do not reload the entire grid.
gridObj.getRowByIndex(rowIndex[0]).css("color", "red");//error in calling
}
}
|
Query |
Response |
ej.web.all.min.js:10 Uncaught TypeError: Cannot read property '3' of null(…)
getDataByIndex @ ej.web.all.min.js:10 (anonymous function) @ VM384:1 markOriginRow @ GridFeatures:135 rowSelectVersion @ GridFeatures:79 _trigger @ ej.web.all.min.js:10 _recorddblClickHandler @ ej.web.all.min.js:10 (anonymous function) @ ej.web.all.min.js:10 dispatch @ jquery-1.10.2.min.js:22 l @ ej.web.all.min.js:10 e @ ej.web.all.min.js:10 dispatch @ jquery-1.10.2.min.js:22 v.handle @ jquery-1.10.2.min.js:22 |
We cannot reproduce the issue at our end . could you please update replication procedure. Please share the sample if it is possible.
|
How can I modify the one of the object in the datasource and reload the changes? The items in the datasource are connected to observables instances? Because one of the issues is the user needs to mark stuff over the grid and change some properties. Then with a save all button, if he wants persists all the changes. If he decided to avoid the changes, the reload of the screen will clean all the temporal changes. |
Grid already support this features through “Batch” editing . please find the online demo link.
Note :
This is not meet your requirement , please share the more details about your information.
1.Which type of editing used in your sample
|
function markOriginRow(args) {
if (!ej.isNullOrUndefined(rowIndex)) {
console.log('args ' + args);
var gridObj = $("#FlatGrid").ejGrid("instance");
gridObj.getRowByIndex(rowIndex[0]).css("color", "red");
undo = $.extend(true, [], gridObj.model.dataSource)
gridObj.getCurrentViewData()[rowIndex[0]].Verified = true;
gridObj.getCurrentViewData()[rowIndex[0]].Symbol = 4;
gridObj.getCurrentViewData()[rowIndex[0]]//get parent Data
gridObj.getCurrentViewData()[rowIndex[0]].Symbol = args;
//this.selectRows(rowIndex);
//get selected row and assign Symbol value to args and reload that row only to show change. Do not reload the entire grid.
}
}
|
[create button]
@(Html.EJ().Button("btn").Text("Save").ClientSideEvents(eve => eve.Click("ConfirmSaveAction")))
[copy the old data in before performing]
function markOriginRow(args) {
if (!ej.isNullOrUndefined(rowIndex)) {
console.log('args ' + args);
var gridObj = $("#FlatGrid").ejGrid("instance");
gridObj.getRowByIndex(rowIndex[0]).css("color", "red");
undo = $.extend(true, [], gridObj.model.dataSource) //copy the parent Grid data in before performing
}
}
[Save confirmation]
function ConfirmSaveAction() {
var gridObj = $("#FlatGrid").ejGrid("instance");
var confirmation = window.confirm("Do you want to save");
if (confirmation)
gridObj.refreshContent();
else
gridObj.dataSource(undo);
}
|