Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    formatCellValue calls after startEditingNew

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

    Hello, I've got a problem in my application which I managed to replicate in the showcase, please try this test case:

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width: 700, height: 224,
        showFilterEditor: true,
        initialSort: [
            {
                property: "countryName",
                direction: "ascending"
            }
        ],
        dataSource: worldDS,
        fields: [
            {name: "countryName"},
            {name: "continent"},
            {
                name: "government",
                formatCellValue: function (value, record, rowNum, colNum, grid) {
                    isc.logEcho(record, "formatCellValue " + rowNum)
                }
            },
            {name: "area"},
            {name: "gdp"},
            {name: "independence", width: 100}
        ]
    })
    then if you run countryList.startEditingNew() you'll see a WARN:

    Code:
    *15:52:44.505:WARN:gridEdit:countryList:startEditing() passed bad cell coordinates:1000,0, can't edit
        ListGrid.startEditing(_1=>1000, _2=>0, _3=>undef, _4=>undef, _5=>undef) on[ListGrid ID:countryList] @ ISC_Grids.js:2264:97
        ListGrid.startEditingNew(_1=>undef, _2=>undef) on[ListGrid ID:countryList] @ ISC_Grids.js:2456:6
        null.<anonymous>(<no args: exited>) @ [no file]:1:13
    and data will be fetched (I wasn't expecting this).

    Instead if you run countryList.startEditingNew({continent:"Asia"}) you'll see also many calls to formatCellValue with record === null (for rowNums==0 to 8, and from 992 to 999, for rowNum == 1000, you'll see a record with the continent value).

    is this a bug, or has there been some change in behaviour? Currently my code does not expect record to be null, and even the fetch seems unexpected

    #2
    also note that in my actual use case I've got autoSaveEdits:false

    Comment


      #3
      Hello, any news about this issue?

      Out of curiosity, I've tried the test case in 14.1 and 15.0 also, and I see the same behaviour.
      Last edited by claudiobosticco; 28 Mar 2025, 02:43.

      Comment

      Working...
      X