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

Replacing Columns of a Grid with frozen column when switching page causes JS error

    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
    • Security Level: Jimmy
    • Labels:
      None
    • Environment:

      Chrome 34

      Description

      Reproducing Steps:

      1. run with attached zul and composer
      2. scroll the bar to the right
      3. switch to next page

      Actual:

      An JS error is showed.
      無法處理:
      setAttr
      Cannot read property 'cells' of undefined (TypeError)

      JS stack trace:

      Uncaught TypeError: Cannot read property 'cells' of undefined zul.mesh.wpd:3230
      zul.mesh.Frozen.zk.$extends._doScrollNow zul.mesh.wpd:3230
      zul.grid.Grid.zk.$extends.refreshBar_ zul.grid.wpd:382
      zk.override.setResetDataLoader zk.wpd:28279
      zk.copy._set2 zk.wpd:10268
      zk.Widget.zk.$extends.set zk.wpd:15373
      zAu.cmd1.setAttr zk.wpd:19963
      doProcess zk.wpd:19032
      doCmdsNow zk.wpd:19273
      zAu._doCmds zk.wpd:19513
      afterResponse zk.wpd:19164
      onResponseReady
      

      Expected:

      switch to next page and no JS error shows.



      Workaround:

      Set the property below and this issue doesn't appear.

      <library-property>
          <name>org.zkoss.zul.nativebar</name>
          <value>true</value>
      </library-property>
      


      Customer's Comment

      Customer said: "code for columns creation in paging() of PagingComposer.java was redundant code and it didn't necessary to business logic". That means creating Columns when onPaging event happens is not their real requirement. After the user remove those codes, the issue disappear.

        Attachments

        1. jsError.png
          jsError.png
          7 kB
        2. PagingComposer.java
          2 kB
        3. pagingGridIssue.zul
          0.8 kB
        4. scrollGrid.png
          scrollGrid.png
          5 kB

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: