-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi!
I need to trigger one event listener, when one listitem finishes the rendering when using the Render On Demand on listbox. I was using the onAfterRender of the listbox, but when I access to last listitem loaded, they still do not have the value binded, because some elements haven't been loaded yet. There is anyway to do this?
Thanks, Regards, Jaime
http://zkfiddle.org/sample/3kj2d8h/1-Listbox-ROD-trigger-event-of-new-page-rendered (Pratical example)
What I need is one simple way to trigger one event when one new page is loaded by ROD. Maybe I need to override some JS method, but I'm doing one custom component development, and for me it's acceptable do the trick.
With ROD enabled an onDataLoading event is triggered (before the elements are rendered). In a listener you can post a custom event (e.g. "onAfterDataLoading") with a lower priority which will then be called after the listitems have been created.
see updated example: http://zkfiddle.org/sample/3kj2d8h/2-Listbox-ROD-trigger-event-of-new-page-rendered
However usually this it not needed since you already know the elements in your model even before they are rendered. Inside your template or item renderer you can setup any event listener you want without having to wait until everything is rendered.
Basically when using a listmodel as the source for listitems it's generally an error to access the listitems directly. The information required should already be in the model or added inside the template. Adding things later will just cause inconsistencies between the model and the component tree.
So if you can share some reasons why you think you need to access the listitems after rendering I am sure there is a better solution.
Asked: 2017-07-06 08:03:40 +0800
Seen: 24 times
Last updated: Jul 07 '17
ZK Clustering, Session Replication Question [closed]
Problem binding values to a composite component
[Ugent please] connect Web service .net view in grid group ZK
my login/index zul page is loading twice, where as i am only calling it once
ZK drang and drop and databinding [closed]
EventQueue working, but data not refreshing
Create Crud of a User that has a collection of books
Create a Zk session variable with a menu
Please provide a SIMPLE running example e.g. on http://zkfiddle.org/, your descriptions are a little vague to give a concrete answer.
cor3000 ( 2017-07-07 08:00:57 +0800 )edithere it is: http://zkfiddle.org/sample/3kj2d8h/1-Listbox-ROD-trigger-event-of-new-page-rendered
eclipse2 ( 2017-07-07 09:52:58 +0800 )edit