-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
I have a table in database with a couple of colums, namely "number of day" (range 1 to 31) and "action" (Y or N)
I want to show those values using a grid object but I would like to build a grid which shows 7 columns and 5 rows (example row1-> day1-action1 day2-action2 ... day7-action7 row2->day8-action8 .. day14-action14, ..., row 5->day29-action29 day30-action30 day31-action31)
How could I build the template, row, etc components to be able to fetch data from database and get this kind of 'horizonal' fetching ?
Thanks
Alfredo
PS: Using ZK CE 9.6
Simplest option would be to build a ListModelList containing arrays or lists of values.
ListModelList<arraylist<daydata>> = new ListModelList...
This way, you'd have a two-dimensional model.
From there, the grid will generate rows based on the first level object: ArrayList<daydata>, which you will need to iterate over in order to generate cells according to the data.
Of course, it's up to you to fill that model with DayData in the first place.
As a CE developer, I'd say the simplest iteration option for you would be to use a Renderer to create the row content.
Alternatively, you can consider a zul iteration option, such as the forEach attribute.
Asked: 2023-06-05 14:44:19 +0800
Seen: 5 times
Last updated: Jun 07