On Apr 16, 2008, at 4:23 PM, greghauptmann wrote:
> - monitoring when a use clicks in a cell (i.e. to trigger going into
> editable mode) &
> - leaves a cell (i.e. clicks somewhere else outside the cell)
I would try listening to click to start the replacement process, and
blur on the resulting text input, that won't keep firing every time
there is a change inside the field.
Give your cells unique IDs, probably following the Excel A1 - ZZZ999
or whatever format, then listen to the entire table:
$('your_table_id').observe('click',function(evt){
var elm = Event.element(evt);
//now you know the precise element that was clicked
elm.update('your form element here');
//focus the form field
elm.down('input').activate();
elm.down('input').observe('blur',function(){
new Ajax.Updater ... etc ...
});
});
>
> Can class name be used somehow can it? e.g. can you say: Listen for
> All Mouse Down events that occur in elements with class name XYZ? Not
> sure what you were getting at here exactly.
That would be another way to approach this, using a class="edit" or
something like that on a collection of things. Then you could use the
double-dollar function to get them all as an array, and add the
editable features to them. My money is on the former approach, as it
scales much better than Observing. Every. Little. Thing.
Walter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---