grid showing horizontal data

asked 2023-06-05 14:44:19 +0800

AlfredoGuiral gravatar image AlfredoGuiral


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 ?



PS: Using ZK CE 9.6

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2023-06-07 23:43:35 +0800

MDuchemin gravatar image MDuchemin
2390 1 6
ZK Team

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.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2023-06-05 14:44:19 +0800

Seen: 5 times

Last updated: Jun 07

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More