[Seaside] [Q] Conditional Updating Using Scriptaculous
renggli at gmail.com
Sat Jan 12 09:24:18 UTC 2008
> To update element with id 'id', I can use html updater id:'id'; ... in scriptaculous.
> But there're times that updating is not needed conditionally. For example,
> div element "itemList" does have 1000+ sub element in itself and a link
> for updating 'itemList' is clicked, but there's no new element added so updating
> should not be done. (Doing update does not harm, but it takes 10+ seconds).
> How can I do this, "updater with condition"?
As you say, you use a condition.
callback: [ :r | ... ];
condition: ((html element
addDecoration: (SUBinary new operator: '<='; statement: 1000))
For the last line you maybe want to add some conveniance method to
SUObject, this looks a bit ulgy right now.
the script in an editor and include it as an external file.
More information about the seaside