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

mesh header sorting style out of sync

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.5.2.1, 8.6.2
    • Fix Version/s: 8.6.3
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:
    • gh.sprint.customfield.default.name:
      ZK 8.6.3 S1

      Description

      Steps to Reproduce

      run the attachment toggle-column-sorting.zul

      click the buttons to toggle column sorting for column 1 and 2

      Current Result

      initially the columns are rendered correctly

      click col1 disable sort -> col1 keeps the css class z-column-sort
      click col1 enable sort -> col1 is marked as sorted 'ascending' (even if order is still 'natural')

      click col2 enable sort -> col2 doesn't get the class z-column-sort, instead the icon gets both classes z-icon-caret-up z-icon-caret-down making it look like 'ascending'

      Expected Result

      column and sorticon classes reflect the actual state of the component

      Debug Info

      the example uses a background color to highlight columns with class .z-column-sort

      Root Cause

      Workaround

      enable the commented script in the attachment:

          zk.afterLoad('zul.mesh', function() {
          	var xSortWidget = {};
          	zk.override(zul.mesh.SortWidget.prototype, xSortWidget, {
          		setSortAscending : function(type) {
          			xSortWidget.setSortAscending.apply(this, arguments);
          			this.syncSortingStyles();
          		},
          		setSortDescending : function(type) {
          			xSortWidget.setSortDescending.apply(this, arguments);
          			this.syncSortingStyles();
          		},
          		syncSortingStyles: function() {
          		    if(this.desktop) {
                          jq(this).toggleClass(this.$s('sort'), this.isSortable_());
                              if(this.isSortable_()) {
                                  var sortDir = this.getSortDirection();
                                  this._sortDirection = null;
                                  this.setSortDirection(sortDir);
                              }
          		    }
          		}
          	});//zk.override
          });//zk.afterLoad
      

        Attachments

          Activity

            People

            • Assignee:
              DevChu DevChu
              Reporter:
              cor3000 cor3000
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: