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

Header sort icon not cleared on model change

XMLWordPrintable

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

      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

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

              Created:
              Updated:
              Resolved:

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