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

Open detail cause infinite loop when overrided icon sclass

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.2
    • 7.0.1
    • Components
    • None

      <zk xmlns:w="client">
          <grid width="400px">
              <columns>
                  <column vflex="1"/>
              </columns>
              <rows>
                  <row>
                      <detail>
                  <attribute w:name="getIconOpenClass_">
                  	function () { return 'z-icon-caret-down';  }
                  </attribute>
                  <attribute w:name="getIconCloseClass_">
                  	function () {return 'z-icon-caret-right';  }
                  </attribute>
                          <label value="Show" />
                      </detail>
                  </row>
              </rows>
          </grid>
      </zk>
      

      Workaround: Add the following script in zul

      <script><![CDATA[
      zk.afterLoad('zkex.grid', function() {
      	zk.override(zkex.grid.Detail.prototype, 'onShow', function () {
      		if (this._open) {
      			if (!jq(this.$n('icon')).hasClass(this.getIconOpenClass_()))
      				this.open(this._open, true);
      		}
      	});
      });
      ]]></script>
      

            jumperchen jumperchen
            RaymondChao RaymondChao
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: