-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi, I got a grid like this:
<grid id="GridPrincipal" sclass="gridPrincipal" model="@init(vm.listaSeguimiento)" hflex="true" vflex="true" mold="paging" sizedByContent="true" emptyMessage="@load(vm.labelsSts.getLabel('noDatos'))" autopaging ="true" style="min-width:min-content" span="3">
<custom-attributes org.zkoss.zul.grid.autohidePaging="false"/>
<custom-attributes org.zkoss.zul.grid.rod="true" scope="page"/>
<columns menupopup="auto" sizable="true" >
<column id="ColSelector" width="40px" label="Selector" sclass="hiddenSelector" iconSclass="z-icon-info" />
<column id="ColId" label="_id" tooltiptext="id" sort="auto(idDocumento)" hflex="min" sclass="hiddenbutton"/>
<column id="ColFechaAlta" label="_Fecha alta" sort="auto(fechaAlta)" hflex="min" sclass="hiddenbutton"/>
<column id="ColSolicitante" label="_Solicitante" sort="auto(datosUsuario)" hflex="min" sclass="hiddenbutton"/>
<column id="ColDocumentos" label="_Documentos" sort="auto(ruta)" hflex="min" sclass="hiddenbutton"/>
<column id="ColFirmas" label="_Firmas" sort="auto(numFirmantes)" hflex="min" sclass="hiddenbutton"/>
<column id="ColEstado" label="_Estado" sort="auto(estado)" hflex="min" sclass="hiddenbutton"/>
<column id="ColEstadoLogico" label="_Estado Logico" sort="auto(estadoLogico)" hflex="min" sclass="hiddenbutton"/>
<column id="ColTipo" label="_Tipo" sort="auto(tipoDocumento)" hflex="min" sclass="hiddenbutton"/>
<column id="ColEtiqueta" label="_Etiqueta" sort="auto(etiqueta)" hflex="min" sclass="hiddenbutton"/>
<column id="ColArea" label="_Area" sort="auto(area)" hflex="min" sclass="hiddenbutton"/>
<column id="ColCentroExplotacion" label="_Centro Explotación" sort="auto(centroExplotacion)" hflex="min" sclass="hiddenbutton"/>
<column id="ColNumPreguntas" label="_Num.Preg." sort="auto(ratioPreguntas)" hflex="min"
sclass="hiddenbutton"/>
</columns>
...
</grid>
I would like to know if there is any option to have at the sime time:
I do not want to span all columns but only 3 of them, in this case: "Solicitante", "Tipo documento", "Centro explotación".
Thank you,
Javier
Hi Javier,
To clarify what you mean by "span the columns" in this context:
[ A ][ B ][ C ] [Cell1 ] [Cell2 ][c3 ]
In this example, cell1 is spanning 3 columns, cell2 is spanning 2 columns, and cell3 is spanning 1 column
Based on your screenshot, it looks like all of your cells already contain data, so I'm not sure that "cell spanning over multiple columns" is what you actually want to do.
Based on your description, do you mean you want to control column widths? If I understood correctly, I think you want all of your columns to be "as small as necessary to display their cells content", except 3 of them, which would share the rest of the available width? Is that correct?
If so, you can achieve this with column hflex, see sample here:
https://zkfiddle.org/sample/escug8/5-Grid-column-hflex
A column with hflex="min" will size down to the minimum necessary to display its cells' content. A column with hflex="1" (or other number) will share the remaining space with other columns with hflex values declared, by a proportion of the declared number.
Asked: 2022-05-09 15:33:29 +0800
Seen: 7 times
Last updated: May 16 '22