[Seaside] #onScroll: with positions
chaetal at gmail.com
Wed Mar 26 05:50:13 UTC 2008
> > We would like to implement a GoogleReader-like table component which
> > loads additional data to the table while scrolling down to (or near)
> > the bottom. We tried #onScroll: event but it does not include position
> > parameters for scroller. The possible decision is to implement a
> > client-side script posting those parameters, but we are not sure how
> > to do it in practice.
> Note that onScroll: is not a standard event, so most certainly it
> won't work on all browsers. Never the less, you can try something like
> the following:
> html div id: 'info'.
> self session addLoadScript: (html scriptaculous event
> observe: html scriptaculous window
> on: 'scroll' do: (html updater
> id: 'info';
> callback: [ :v | x := v ] value: (html scriptaculous
> window access: 'scrollX');
> callback: [ :v | y := v ] value: (html scriptaculous
> window access: 'scrollY');
> callback: [ :r | r render: x , ' x ' , y ])).
We found this decision:
onScroll: (html request callback: [:val | self halt]
value: (SUStream on: 'this.scrollTop'));
Does it have many drawbacks?
More information about the seaside