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

Nested detail receives onStripe when no fake node exists in ZK 10

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 10.2.0
    • 10.0.0
    • None
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      Run fiddle
      https://zkfiddle.org/sample/18oro20/8-nested-open-detail-fails-js-error
      Click button

      Current Result

      Failed to mount: Cannot set properties of undefined (setting 'className')

      Expected Result

      No error

      Debug Information

      onStripe is invoked on detail in zk10, wasn't invoked on zk9
      When invoked, "fake" node is already destroyed

      Workaround

        		<script><![CDATA[
      		zk.afterLoad("zk", function () {
      			/* THIS WORKAROUND FOR 5725 ALLOWS THE CURRENT ISSUE TO BE REPRODUCED */
                  /**
                   * Purpose: https://tracker.zkoss.org/browse/ZK-5725
                   * Based on version: 10.0.0
                   * Last update: 10.0.0
                   */
                  if(zk.version != '10.0.0'){
                     console.warn('This override script version compatibility was tested for ZK 10.0.0. If you are running a different version, please check this script compatibility ');
                  }
      		    var _xWidget = {};
      		    zk.override(zk.Widget.prototype, _xWidget, {
      		        $n_: function(M) {
      	                var z = this.$n(M);
      	                if (null == z)
      	                    console.warn( "Node " + (M ? "with " + M : "") + " is not found!");
      	                return z
      	            }
      		     });
      
      			
                  /**
                   * Purpose: 
                   * Based on version: 10.0.0
                   * Last update: 10.0.0
                   */
                  if(zk.version != '10.0.0'){
                     console.warn('This override script version compatibility was tested for ZK 10.0.0. If you are running a different version, please check this script compatibility ');
                  }
      		    var _xDetail = {};
      		    zk.override(zkex.grid.Detail.prototype, _xDetail, {
      		        onStripe: function(t) {
      
      					this._open && this.$n("fake") && (this.$n_("fake").className = this.parent.$n_().className + " " + this.$s("faker"))
      				}
      		     });
      
      		});
      	]]></script>
      

            Unassigned Unassigned
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: