[Seaside] Use of onMouseOver: and onMouseOut: in Seaside 2.8x
rickf at ca-flower.com
Sat Nov 8 02:35:57 UTC 2008
One more followup.. I'm getting somewhere -- just not sure where..
Anyway, I've now modified the following code (yes, I realize I'm whacking
up my image, but I can live with that!) :
WATableReport>>renderRowNumber: index item: row on: html
script: (Scriptaculous.SUEvent new
observe: (Scriptaculous.SUStream on: 'document')
do: (html effect highlight));
style: 'background-color: ' , (self colorForRowNumber: index);
columns do: [ :each |
self renderColumn: each row: row on: html ] ]
for each row, which makes me think that my '#observe' method above is
wrong and is currently telling it to look at the entire document instead
of the row in question.. Now, I tried changing 'document' to be 'foobar'
and ensured that the above tableRow had #id: #foobar but no difference and
Firebug was complaining about foobar not being defined..
Anyway, I think I'm close.. Does anyone have better examples on the
use of #observe: on: do:? There are only a few examples and none doing
anything other than using the entire document..
On Fri, November 7, 2008 4:58 pm, Rick Flower wrote:
> Ok -- just to reply to myself.. I was missing the need to add SULibrary
> to the list of libraries that the Dispatch editor indicates.. Once I did
> that the prototype (and related) libraries were loaded so no more error..
> Now, I did end up copying the code below to my test from one of the
> Scriptaculous examples and it runs great and highlights EVERYTHING but I
> only want it to highlight a single <TR> in a table when the mouse hovers
> over it.. Any ideas how to tailor it to down-scope what it highlights?
> html script: (Scriptaculous.SUEvent new
> observe: (Scriptaculous.SUStream on: 'document')
> on: 'mouseover'
> do: (html effect highlight; id: Scriptaculous.SUEvent new element)).
> On Fri, November 7, 2008 3:43 pm, Rick Flower wrote:
>> By the way, I modified the existing Seaside Unit Test
>> to have a #renderContentOn: method as follows (the rest of the test code
>> is the same) :
>> WATableReportTest>>renderContentOn: html
>> self session addLoadScript: (html selector
>> add: 'tr.effect';
>> do: [ :each |
>> each element on: 'mouseover' do:
>> each element on: 'mouseout' do:
>> html render: report.
>> Unfortunately, I must be doing something wrong as Firebug complains
>> the use of '$$' below in the generated script... Any ideas what I've
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside