1

Grid scrolling [closed]

asked 2013-06-20 10:44:11 +0800

uhegel gravatar image uhegel
45 3

updated 2013-06-21 08:25:54 +0800

Is it possible to scroll a grid (live data, ROD) to top? (After changing or updating ListModel)

fireEvent(ListDataEvent.STRUCTURE_CHANGED, -1, -1)

updates the grid, but scrolling stays on the current position - even if the position is after the last row (when row count gets smaller).

Clients.scrollIntoView(getRows().getFirstChild())

does not work - I think because of ROD

invalidate does not help.

I have figured out, that the whole problem only happens, when ROD is activated for the grid. Without rod everything works as expected. After changing the List Model and notifying ListData Event Listeners the grid will scroll to the first row.

With ROD enabled the scroll position stays where it is. You can sometimes see, that it scrolls to the first row for a moment and then goes to the preserved scroll position: It seems that there is some code on client side, which preserves the scroll position in ROD Mode. I will have a look at the sources. Maybe I will understand what happens and, with a bit of luck, there is a way to control this behaviour.

If there is someone out there, who already knows what happens in ROD Mode, it would be great to get some helping information...

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by sjoshi
close date 2013-07-12 13:50:00

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-07-12 11:22:36 +0800

uhegel gravatar image uhegel
45 3

updated 2013-07-12 13:49:35 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

Finally I found solution. Tell the Client to scroll up:

for a grid with id mytestgrid:

Clients.evalJavaScript("zk.Widget.$('$mytestgrid').ebody.scrollTop = 0");
link publish delete flag offensive edit
2

answered 2013-06-21 07:08:24 +0800

hswain gravatar image hswain flag of India
1763 3 10
http://corejavaexample.bl...

simple use invalidate in grid.

link publish delete flag offensive edit

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-06-20 10:44:11 +0800

Seen: 45 times

Last updated: Jul 12 '13

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