Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4614

MeshWidget _cpCellWd tries to access unloaded rows if tree has footer but no treecol

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 9.1.0
    • Fix Version/s: 9.5.0
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:
    • gh.sprint.customfield.default.name:
      ZK 9.5.0 S1

      Description

      Steps to Reproduce

      https://zkfiddle.org/sample/2cifl1i/1-Large-tree-with-treefoot-but-no-treecols-cause-JS-error

      click the button to add rows

      Current Result

       

      Uncaught TypeError: Cannot read property 'cells' of undefined
          at _cpCellWd (zul.mesh.wpd:364)
          at init._calcSize (zul.mesh.wpd:1216)
          at init.onSize (zul.mesh.wpd:1109)
          at init.$supers (zk.wpd:12956)
          at init.onSize (zul.sel.wpd:3938)
          at init.onSize (zk.wpd:46082)
          at _invoke (zk.wpd:16465)
          at init.fire (zk.wpd:16448)
          at _fire (zk.wpd:16591)
          at Object.fireDown (zk.wpd:16808)
      

       

       

      Expected Result

      calculation doesn't cause error

      Debug Information

      https://github.com/zkoss/zk/blob/d050198077c1e285616e9d01771635ea48d5ad31/zul/src/archive/web/js/zul/mesh/MeshWidget.js#L353

      srcrows contains loaded rows only, but wgt.getBodyWidgetIterator provide all items (including unloaded items).

      _cpCellWd is only invoked when there is no treecol

      https://github.com/zkoss/zk/blob/d050198077c1e285616e9d01771635ea48d5ad31/zul/src/archive/web/js/zul/mesh/MeshWidget.js#L1210-L1216

      Workaround

      Add an empty treecol to the tree

      <treecols style="visibility: collapse"> <treecols style="visibility: collapse"> <treecol /> </treecols>

       

        Attachments

          Activity

            People

            Assignee:
            DevChu DevChu
            Reporter:
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: