} else {
JSONObject savedColumns = entityDataService.fromJSON(profile.getSetting(), JSONObject.class);
if (savedColumns.keySet().equals(columns.keySet())) {
+// log.info("{}", Strings.join(objects, ','));
+ columnSettings.keySet().forEach(colName -> {
+ LinkedHashMap<String, Object> colSetting = (LinkedHashMap<String, Object>) savedColumns.get(colName);
+ if (!colSetting.containsKey("visible")) {
+ colSetting.put("visible", true);
+ }
+ });
columnSettings = savedColumns;
} else {
saveProfileSetting();
private void addColumn(String name, String direction) {
JSONObject sort = new JSONObject();
sort.put("sortDirection", direction);
+ sort.put("visible", true);
columnSettings.put(name, sort);
if (!direction.equals(NATURAL)) {
<toolbarbutton mode="toggle" iconSclass="z-icon-adjust" label="Mind"
checked="@bind(vm.filterShowBoth)"/>
</toolbar>
+
</north>
<center border="none" flex="true">
- <listbox vflex="true" model="@load(vm.partnersDataModel)"
- autopaging="true" mold="paging" pagingPosition="top" multiple="false"
- onSelect="@command('onListSelection')">
- <listhead sizable="true">
- <listheader label="Név" sort="auto(name)" align="left"
- sortDirection="@load(vm.cols['name'].sortDirection)"/>
- <listheader label="Adószám" sort="auto(vatNr)" align="left"
- sortDirection="@load(vm.cols['vatNr'].sortDirection)"/>
- <listheader label="Cím" sort="auto(address)" align="left"
- sortDirection="@load(vm.cols['address'].sortDirection)"/>
- <listheader label="Aktív" sort="auto(active)" align="left"
- sortDirection="@load(vm.cols['active'].sortDirection)"/>
+ <vlayout>
+ <!-- https://www.zkoss.org/wiki/ZK_Developer%27s_Reference/MVVM/Data_Binding/Children_Binding-->
+ <menupopup id="editPopup">
+ <menuitem label="Group" image="~./zul/img/grid/menu-group.png"/>
+ <menuitem label="Sort Ascending" image="~./zul/img/grid/menu-arrowup.png"/>
+ <menuitem label="Sort Descending" image="~./zul/img/grid/menu-arrowdown.png"/>
+ </menupopup>
+ <listbox vflex="true" model="@load(vm.partnersDataModel)"
+ autopaging="true" mold="paging" pagingPosition="top" multiple="false"
+ onSelect="@command('onListSelection')">
+ <listhead sizable="true" menupopup="editPopup">
+ <listheader label="Név" sort="auto(name)" align="left"
+ visible="@bind(vm.cols['name'].visible)"
+ sortDirection="@load(vm.cols['name'].sortDirection)"/>
+ <listheader label="Adószám" sort="auto(vatNr)" align="left"
+ sortDirection="@load(vm.cols['vatNr'].sortDirection)"/>
+ <listheader label="Cím" sort="auto(address)" align="left"
+ sortDirection="@load(vm.cols['address'].sortDirection)"/>
+ <listheader label="Aktív" sort="auto(active)" align="left"
+ sortDirection="@load(vm.cols['active'].sortDirection)"/>
+
+ </listhead>
+ <template name="model">
+ <listitem onDoubleClick="@command('onEdit')">
+ <listcell label="@load(each.name)"/>
+ <listcell label="@load(each.vatNr)"/>
+ <listcell label="@load(each.address)"/>
+ <listcell>
+ <a iconSclass="z-icon-check" visible="@load(each.active)"/>
+ <a iconSclass="z-icon-ban" visible="@load(!each.active)"/>
+ </listcell>
+ </listitem>
+ </template>
+ </listbox>
- </listhead>
- <template name="model">
- <listitem onDoubleClick="@command('onEdit')">
- <listcell label="@load(each.name)"/>
- <listcell label="@load(each.vatNr)"/>
- <listcell label="@load(each.address)"/>
- <listcell>
- <a iconSclass="z-icon-check" visible="@load(each.active)"/>
- <a iconSclass="z-icon-ban" visible="@load(!each.active)"/>
- </listcell>
- </listitem>
- </template>
- </listbox>
+ </vlayout>
</center>
</borderlayout>
</window>