Hi,

Your first version should be working. Assuming _msoSGrid is in scope
in that function, `_msoSGrid.load(event.memo.Json);` _will_ call
`load` with `this` set to `_msoSGrid`.

Your second example doesn't work because all you're doing is binding
the function, not actually calling it. But there's no reason to bind
the function, you're already effectively doing that in your first
example.

So the first example is correct, but apparently there's some problem
in the surrounding code; you'll have to show us that.

[Super-freaky bracing style. :-)]

HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com


On Dec 24, 7:34 pm, kstubs <[email protected]> wrote:
> OK, I'm confused.  I'm observing a custom event "MeetQuery:lookup_scores"
> which is working fine (not the problem as I can see) and I need to call
> _msoSGrid.load in the context of _msoSGrid.  As is, the context of this in
> the load event is Window; it should be _msoSGrid.  
>
> ** below code set on document:load **
>
>     document.observe('MeetQuery:lookup_scores', function(event) {
>         _msoSGrid.load(event.memo.Json); }
>     );
>
> ** this does not work **
>
>     document.observe('MeetQuery:lookup_scores', function(event) {
>         _msoSGrid.load.bind(_msoSGrid, event.memo.Json); }
>     );
>
> What's wrong?  

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to