You don''t want the :update => ''element_id''
parameter in that case (as
you''re not going to update the contents of the element).
You want
:complete => "$(''#{position.id}").style.textDecoration =
''line-
through''"
without the :update stuff. (note this is from memory, untested!).
Cheers,
Thomas
Am 09.11.2005 um 11:22 schrieb Kev Jackson:
> Hi All,
>
> I have an element in a table, and on a callback after an AJAX call
> I''d like to change the font-style of the text in the element.
>
> I currently have
>
> Calling view
> <div id=''<%= position.id %>''>
> <tr>
> <td align="left" valign="top"><%= link_to
> position.job_title, :action => ''show'', :id =>
position %></td>
> <td align="left" valign="top"><%=
position.salary %></td>
> <td align="left" valign="top"><%=
position.location %></td>
> <td align="left">
> </td>
> </tr>
> <tr>
> <td align="left" rowspan="5"
colspan="3"><%=
> position.description %></td>
> <tr><td><%= link_to ''Edit'', :action
=> ''edit'', :id => position %
> ></td></tr>
> <tr><td><%= link_to ''Destroy'', {
:action => ''destroy'', :id =>
> position }, :confirm => ''Are you sure?''
%></td></tr>
> <tr><td><%= link_to_remote(''close'',
> :update => "#{position.id}",
> :url => { :action => :close, :id => position },
> :confirm => ''Are you sure you wish to close this
> position?'',
> :complete => <do something?>
%></td></tr>
> <tr><td><%= link_to ''apply'', { :action
=> ''apply'', :id =>
> position }, :confirm => ''Are you sure you wish to apply for
this
> position?'' %></td></tr>
> </tr>
> </div>
> Controller
>
> def close
> position = Position.find(params[:id])
> position.close
> if position.save
> render(:layout => false)
> end
> end
>
> returned view
>
> <%= update_element_function(
> ''1'', :action => :update, <something?>
> ) %>
>
> I''ve been trying to track this down for a while now and I
can''t
> find an example of anything similar. Does anyone have an example
> of something that manipulates the original text of the div? Most
> examples of link_to_remote seem to add text, I haven''t seen
> anything that alters the text style
>
> Kev
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails