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

listheader sortDirection not working when template is used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.2
    • 8.6.1
    • Components, Databind 2
    • Security Level: Jimmy
    • Windows 10, Oracle JDK 1.8.0_201, Tomcat 8.0.47, ZK 8.6.1.FL.20190201

    • ZK 8.6.2 S1, ZK 8.6.2 S2
    • None

      When setting the sortDirection in a listheader and a template is in use, the icon is not shown.

      public class SortVM {
      	public class Resource {
      		private String code;
      		private String description;
      		public Resource(String code, String description) {
      			this.code = code;
      			this.description = description;
      		}
      		public String getCode() { return code; }
      		public String getDescription() { return description; }
      	}
      
      	public Resource[] getResources() {
      		return new Resource[] { new Resource("01", "ZZZ"), new Resource("02", "AAA") };
      	}
      }
      
      <listbox viewModel="@id('vm') @init('SortVM')" model="@load(vm.resources)">
      	<listhead>
      		<listheader label="Code" sort="auto(code)" sortDirection="ascending" />
      		<listheader label="Description" sort="auto(description)" />
      	</listhead>
      	<template name="model">
      		<listitem>
      			<listcell label="${each.code}" />
      			<listcell label="${each.description}" />
      		</listitem>
      	</template>
      </listbox>
      

            rudyhuang rudyhuang
            benedetti benedetti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Time Spent - 2 hours Remaining Estimate - 6 hours
                6h
                Logged:
                Time Spent - 2 hours Remaining Estimate - 6 hours
                2h