Uploaded image for project: 'Keikai'
  1. Keikai
  2. KEIKAI-600

Multiple row height reduction in the same command cause JS error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 5.11.0
    • 5.9.0
    • None
    • Security Level: Jimmy
    • None
    • None

      Steps to Reproduce

      run attached sample

      Current Result

      zss.wpd:660 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'appendZSH')
          at r.appendZSH (zss.wpd:660:143)
          at r._appendZSH (zss.wpd:1506:134)
          at r._setRowHeight (zss.wpd:1508:138)
          at r._setRowHeight (zssex.wpd:203:501)
          at r._cmdSize (zss.wpd:1429:314)
          at _doSizeCmd (zss.wpd:446:217)
          at r._size (zss.wpd:453:478)
          at r.setRowSize (zk.wpd:formatted:4460:31)
          at Function._set2 (zk.wpd:formatted:4508:38)
          at R.<computed>.s.charAt.o.func (zk.wpd:formatted:8724:53)
      

      Expected Result

       No error

      Debug Information

       After each row size command, a pruning of the current row cache is performed

      this.activeBlock.pruneFromRange()

      If more than 1 row height reduction happen in the same transaction, this can cause next row size reduction targeted rows to have been removed from cache, but the size command is already queued.

      When the appendZSH function is called, the target row is no longer in the activeBlock.rows cache, and fails due to row not found.

       

      Workaround

      <script><![CDATA[
      zk.afterLoad('zss', function() {
      	var xMainBlockCtrl = {};
      	zk.override(zss.MainBlockCtrl.prototype, xMainBlockCtrl ,{
      		appendZSH: function(row, zsh) {
      			if(!this.rows[this._getVisibleRowIndex(row - this.range.top)]){
      				return;
      			}
      			var result = xMainBlockCtrl.appendZSH.apply(this, arguments);
      			return result;
      		}
      	});//zk.override
      });//zk/afterLoad
      ]]></script>
      

            gordonhsu gordonhsu
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: