-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi! I have a problem that I cant resolve. The thing is that I have the menupopup = "auto"> set on <columns> and sort="auto(fecha) on <column> tag. When I hide a column using the menupopup it works fine, but if I wanna sort any column by clicking on it (as sort="auto") the hidden column appears again, it doesnt stay hidden. Any idea why does this hapen?
Also I need to be able to drag columns to change the order (obviously with the data in the rows) and get the sum of one specific column. What do I need to do that? Thanks for the help!
Here's my ZUL. (Im using a renderer for the grid)
<div apply="main.java.grid.dynamic_renderer.ClienteRenderController">
<grid id="grid" model="${$composer.clientes}"
rowRenderer="main.java.grid.dynamic_renderer.ClienteRender"
mold="paging" pageSize="10">
<auxhead sclass="category-center">
<auxheader colspan="6" rowspan="1">
<image src="/img/logo.jpg" width="100%" height="220px" />
</auxheader>
</auxhead>
<columns sizable="true" menupopup = "auto">
<column onCreate="self.sort(true)" sort="auto(id)" tooltiptext="Ordenar" hflex="med" label="ID"/>
<column visible="true" sort="auto(cliente)" tooltiptext="Ordenar" hflex="med" label="Clientes"/>
<column sort="auto(fecha)" tooltiptext="Ordenar" hflex="med" label="Fecha"/>
<column sort="auto(importe)" tooltiptext="Ordenar" hflex="med" label="Importe"/>
<column sort="auto(concepto)" tooltiptext="Ordenar" hflex="med" label="Concepto"/>
<column sort="auto(metodo_pago)" tooltiptext="Ordenar" hflex="med" label="Método de pago"/>
</columns>
</grid>
there is a bug (https://tracker.zkoss.org/browse/ZK-1816) which looks the same to your case, but it's fixed in 7.0.6. Which version do you use?
There is no such built-in features in Grid. You need to implement such behavior by yourself. The overall steps are:
<column draggable="true" droppable="true">
onDrop
event and implement your business logic.
In your onDrop
listener, you can pass the new column order to your RowRender and trigger it to re-render.Please refer to https://www.zkoss.org/wiki/ZKDeveloper%27sReference/UIPatterns/Dragand_Drop
There is no such built-in features in Grid. You need to sum each column based on your model by yourself. Then, show the sum in a footer.
Asked: 2020-01-11 01:53:13 +0800
Seen: 10 times
Last updated: Jan 13 '20
for hidden column issue, I can't reproduce it locally. Could you provide an example? You can replace your data by
hawk ( 2020-01-17 11:32:22 +0800 )editListModelList model = new ListModelList(Locale.getAvailableLocales())