SmartClient Version: v13.1p_2025-04-09/AllModules Development Only (built 2025-04-09)
Hello, in a grid with autoSaveEdits: false, when there are pending edits, I want to change the style of the entire record so that it's clear the record needs to be saved - even when the edit consists of clearing a cell value.
While testing my solution, I believe I've found a bug. Please try the following test case in the editByRow sample:
Code:
isc.IButton.create({
ID: "saveAllButton",
title: "Save All",
click: "countryList.saveAllEdits()"
});
isc.ListGrid.create({
ID: "countryList",
width: 550, height: 224, top: 50,
// use server-side dataSource so edits are retained across page transitions
dataSource: countryDS,
// display a subset of fields from the datasource
autoSaveEdits: false,
modalEditing: true,
canEditCell: function (rowNum, colNum) {
var editedRecord = this.getEditedRecord(rowNum);
var fieldName = this.getFieldName(colNum);
if (fieldName === "countryName" && editedRecord.countryName === 'France') {
return false;
}
return this.Super("canEditCell", arguments);
},
getCellCSSText: function (record, rowNum, colNum) {
if (this.rowHasChanges(rowNum) && !this.recordMarkedAsRemoved(rowNum)) {
return this.editPendingCSSText;
} else {
return this.Super("getCellCSSText", arguments);
}
},
fields: [
{
name: "countryCode",
title: "Flag",
width: 40,
type: "image",
imageURLPrefix: "flags/24/",
imageURLSuffix: ".png",
canEdit: false
},
{name: "countryName"},
{name: "capital"}
],
autoFetchData: true,
canEdit: true
})
1. edit the first and second records by deleting their "Capital" values
2. click "Save All"
3. Edit the second record again by double-clicking the (now empty) "Capital" cell.
4. Exit the cell without typing anything - either by clicking outside the cell or pressing Enter (not Escape)
5. You'll see that the record gets the "pending" style.
In fact, countryList.recordHasChanges(1) returns true and countryList.getEditValues(1) is:
Code:
{pk: 2, capital: null}
Comment