How to auto scroll when a list is drawn or inserted

How to auto scroll when a list is drawn or inserted

  

Hello 


I wrote "overflow: scroll;" in my list's CSS, and I create a action with jacascript, using "$("#talkList").scrollTop($("#talkList")[0].scrollHeight);" to scroll to the bottom.


But, when I put the action into "On Ready" , it scrolls before the list draws.

And when I put the action into "On Render" , it scrolls on the half way of the list is drawing.


How can I make it auto scrolls when the draw of list is end?

Hello Tenchi.

We have being looking into this problem. The OnRender, when the screen change after the OnAfterFetch, seems to be triggered more or less at the same time the DOM is being updated (or something like that).

We didn't tested it, but a workaround would be to include at the end of the list an extra item, And in the list, check for it and execute the JavaScript.

Another possibility would be to bind to the change event and count the items already there, executing the JavaScript.

But they are not "nice" workarounds...

Cheers

Eduardo Jauch wrote:

Hello Tenchi.

We have being looking into this problem. The OnRender, when the screen change after the OnAfterFetch, seems to be triggered more or less at the same time the DOM is being updated (or something like that).

We didn't tested it, but a workaround would be to include at the end of the list an extra item, And in the list, check for it and execute the JavaScript.

Another possibility would be to bind to the change event and count the items already there, executing the JavaScript.

But they are not "nice" workarounds...

Cheers

Hello Eduardo, nice to see you.


Thanks for your reply.


Can you tell me more detail of these two workarounds?

I don't know how to include an extra item or to count the items already.