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

Open detail cause infinite loop when overrided icon sclass

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 7.0.1
    • Fix Version/s: 7.0.2
    • Component/s: Components
    • Labels:
      None

      Description

      <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>
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: