0

Renderer for Listbox footer?

asked 2010-07-10 11:35:38 +0800

Arsen gravatar image Arsen
383 4

Good day, guys.
I have model and renderer for listbox, model is changed very oftenly and fires DataChange event causes rendrer to redraw changed item. This works fine for listitems, but what about footer? Is there any way to set renderer on footer? What model should do to make footer to redrawn?
Code, which changes model, knows nothig about listbox(es) assigned with this model, so I don't have direct access to GUI components.

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2010-07-11 20:19:11 +0800

samchuang gravatar image samchuang
4084 4

Hi

The renderer is for listitem

If you wanna redraw listfoot, you could ask the Listfoot to redraw by calling invalidate()

link publish delete flag offensive edit

answered 2010-07-12 23:00:38 +0800

Arsen gravatar image Arsen
383 4

Thank you for reply, samchuang.
But you see footer data is usualy depends of listitems' data, for most often example is Sum of column. So just invalidate is not enough - new value is need. If I write new value directly into listbox's footer component, then it breaks good MVC model. I think it is good to make model for footer - like interfase ListFooterModel or ListModelFooter, so my class, which impleneting ListModel and ListFooterModel, can control data of entire listbox.

link publish delete flag offensive edit

answered 2010-07-13 03:51:35 +0800

samchuang gravatar image samchuang
4084 4

Hi

to me, I think the reason why use model is because the Data and the UI component to generate is big, On the other hand, every Listbox only allow 1 Listfoot. To me, the Listfoot seems to be a summary for a Listbox, not Listitem. It seems not suitable in your case, in your case you treat it as a summary for Listitem.


In your situation: Sum of column, I think the better idea is to use Listgroupfoot (in ZK PE and ZK EE version)
Listgroupfoot serves as a summary listitem of listgroup.

link publish delete flag offensive edit

answered 2010-07-13 04:09:17 +0800

Arsen gravatar image Arsen
383 4

Thanks for your advice, samchuang, but PE and EE is not option for me at the moment. But you've gave good idea - to add summary row into ListModel and let ListitemRenderer to render summary as simple listitem, with some special css. I think this can work for me.
Thanks again.

link publish delete flag offensive edit
Your reply
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

Follow

RSS

Stats

Asked: 2010-07-10 11:35:38 +0800

Seen: 436 times

Last updated: Jul 13 '10

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