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

Header sort icon not cleared on model change

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Normal
    • 8.6.1
    • 8.5.2.1
    • None
    • Security Level: Jimmy
    • None

    Description

      Steps to Reproduce

      Run fiddle
      http://zkfiddle.org/sample/1aq7fhr/2-grid-sort-style-not-cleared-on-model-change

      click the update model button to load rows.
      click the "click me " header to sort the rows
      click the update model button to reload rows

      Current Result

      After reloading the model, rows are using the natural sorting direction.
      However, the header still displays the last known sorting direction arrow (asc / desc)

      Expected Result

      direction arrow should be cleared on model change

      Debug Info

      Root Cause

      Workaround

      Extend grid such as:

      public class GridEx extends Grid {
      	@Override
      	public void setModel(ListModel<?> model) {
      		super.setModel(model);
      		for (Component column: this.getColumns().getChildren()) {
      			((Column)column).setSortDirection("natural");
      		}
      	}
      }
      

      and declare extended grid in zul or lang-addon

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h