problem with grid.autoSaveEdits: false, and rowHasChanges

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:

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
})

then

  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:

{pk: 2, capital: null}

Hi Claudio
We tried your test case and didn’t see the behavior you’re describing. Could you double check that the sample code you’ve posted here reproduces the issue for you and also share your environment (OS / Browser)?

Thanks

Hello, it happens using Chrome, FF and Safari on MacOS, but there’s a typo in the test case, here is the corrected version:

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
})

We now see the issue and have someone looking into it.
Regards

SmartClient Version: v13.1p_2025-04-23/AllModules Development Only (built 2025-04-23)

Hello, any news about this issue? I still see the problem.

SmartClient Version: v13.1p_2025-10-11/AllModules Development Only (built 2025-10-11)

Hi, just checking in - is there any update on this?

We’ve made a change to address this issue. The fix has been applied to branches 13.1 and above
Please try the next nightly build dated Oct 17 or above and let us know the issue persists

Thanks and Regards
Isomorphic Software

SmartClient Version: v13.1p_2025-10-18/AllModules Development Only (built 2025-10-18)

Hi, I can confirm that now it’s working, thank you very much.