Announcement

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

    Upgrade smarclient version from 10.0 to 13.0 - ListGrid setHeaderSpans() Error

    Hi.
    I am trying to upgrade an application to smartclient 13.

    The same code smartclient 10(pro) is ok, with smartclient 13(eval 13.0-p20230610) rise an error:

    :WARN:Log:TypeError: Cannot read properties of undefined (reading 'masterIndex')
    Stack from error.stack:
    ListGrid.getDrawnFieldWidths(<no args: exited>) on [RecordEditor ID:vehicleOptConfListGrid_filterEditor] @ ISC_Grids.js:2265:231
    ListGrid.getEditRowItems(<no args: exited>) on [RecordEditor ID:vehicleOptConfListGrid_filterEditor] @ ISC_Grids.js:2258:40
    ListGrid.makeEditForm(<no args: exited>) on [RecordEditor ID:vehicleOptConfListGrid_filterEditor] @ ISC_Grids.js:2235:43
    [c]Class.invokeSuper(<no args: exited>) on [RecordEditor ID:vehicleOptConfListGrid_filterEditor] @ ISC_Core.js:308:93
    [c]Class.Super(<no args: exited>) on [RecordEditor ID:vehicleOptConfListGrid_filterEditor] @ ISC_Core.js:300:170
    RecordEditor.makeEditForm(<no args: exited>) on [RecordEditor ID:vehicleOptConfListGrid_filterEditor] @ ISC_Grids.js:3708:6
    ListGrid.showInlineEditor(<no args: exited>) on [RecordEditor ID:vehicleOptConfListGrid_filterEditor] @ ISC_Grids.js:2182:22
    ListGrid._startEditing(<no args: exited>) on [RecordEditor ID:vehicleOptConfListGrid_filterEditor] @ ISC_Grids.js:2169:6
    RecordEditor.initializeEdit(<no args: exited>) on [RecordEditor ID:vehicleOptConfListGrid_filterEditor] @ ISC_Grids.js:3697:197
    RecordEditor.setFields(<no args: exited>) on [RecordEditor ID:vehicleOptConfListGrid_filterEditor] @ ISC_Grids.js:3697:6
    ListGrid.setFields(<no args: exited>) on [PrpListGrid ID:vehicleOptConfListGrid] @ ISC_Grids.js:1303:240
    ListGrid.setHeaderSpans(<no args: exited>) on [PrpListGrid ID:vehicleOptConfListGrid] @ ISC_Grids.js:3379:794

    and


    Uncaught TypeError: Cannot read properties of undefined (reading 'masterIndex')
    at _3.isc_ListGrid_getDrawnFieldWidths [as getDrawnFieldWidths] (ISC_Grids.js:2265:231)
    at _3.isc_ListGrid_getEditRowItems [as getEditRowItems] (ISC_Grids.js:2258:40)
    at _3.isc_ListGrid_makeEditForm [as makeEditForm] (ISC_Grids.js:2235:43)
    at _3.isc_c_Class_invokeSuper [as invokeSuper] (ISC_Core.js:308:93)
    at _3.isc_c_Class_Super [as Super] (ISC_Core.js:300:170)
    at _3.isc_RecordEditor_makeEditForm [as makeEditForm] (ISC_Grids.js:3708:6)
    at _3.isc_ListGrid_showInlineEditor [as showInlineEditor] (ISC_Grids.js:2182:22)
    at _3.isc_ListGrid__startEditing [as $31u] (ISC_Grids.js:2169:6)
    at _3.isc_RecordEditor_initializeEdit [as initializeEdit] (ISC_Grids.js:3697:197)
    at _3.isc_RecordEditor_setFields [as setFields] (ISC_Grids.js:3697:6)
    at _3.isc_ListGrid_setFields [as setFields] (ISC_Grids.js:1303:240)
    at _3.isc_ListGrid_setHeaderSpans [as setHeaderSpans] (ISC_Grids.js:3379:794)
    at callbackRulesForVehicleOptConf (uowPde?lang=en&applicationAreaId=3:55368:40)


    The code is:
    var headerSpans = [{height: 30, fields: condFields, title: "Condition"}];
    vehicleOptConfListGrid.setHeaderSpans(headerSpans);


    How to solve?

    Thanks.
    Last edited by Enri_000; 5 Jul 2023, 08:16.

    #2
    It's difficult to say with the information you've provided so far - but the stack suggests your condFields variable may have entries for fields which are not available in the grid. One possible reason for this would be that you are calling setHeaderSpans() before the grid has been drawn - setting headerSpans in your create({}) block instead of calling the setter would fix that.

    We'd like to get to the bottom of this, so if you can show more complete code for the grid/DataSource (no data necessary), we can take a look.
    Last edited by Isomorphic; 5 Jul 2023, 21:16.

    Comment


      #3
      I followed the suggestion: set "headerSpans" in the "create" block. I also had to anticipate the creation of other sections of the page, otherwise it would signal other problems. In this way, the section with headerSpans is correctly created.

      Thank you!
      Last edited by Enri_000; 6 Jul 2023, 01:48.

      Comment


        #4
        This sounds like you have not called isc.setAutoDraw(false) - at the least, you should set autoDraw: false on your widgets - otherwise, they will draw in the DOM, and then be cleared and redrawn as they are added to a parent.

        Comment

        Working...
        X