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

tree JS error when replacing treecols

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.6.1
    • 9.5.1.3, 9.6.0.1
    • Components
    • Security Level: Jimmy

      Steps to Reproduce

      run the code

      <zk>
          <button label="replace treecols"
                  onClick='
                  Treecols tco = tr.getTreecols();
                  tco.detach();
                  tr.appendChild(tco);
          '/>
          <tree id="tr" hflex="min">
              <treecols>
                  <treecol label="col-1"/>
                  <treecol label="col-2"/>
              </treecols>
          </tree>
      </zk>
      

      click the button

      Current Result

      zk.wpd:316 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'textContent')
          at zjq.textWidth (zk.wpd:316)
          at c.getContentWidth_ (zul.mesh.wpd:111)
          at c._calcMinWds (zul.mesh.wpd:47)
          at m (zul.mesh.wpd:10)
          at c.beforeMinFlex_ (zul.mesh.wpd:43)
          at Object.fixMinFlex (zk.wpd:705)
          at c.onFitSize (zk.wpd:704)
          at x (zk.wpd:343)
          at y (zk.wpd:343)
          at Object.fireDown (zk.wpd:346)
      

      Expected Result

      no error, just replace the treecols child component of a tree

      Debug Information

      happens in combination with hflex="min" on the tree

      Workaround

      invalidate the whole tree

            jumperchen jumperchen
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: