On Viernes, 19 de Marzo de 2010 01:13:30 Pedro G. escribió:
> Hi,
>
> I have the following situation that I've been unable to solve
> succesfully: in one of the columns of my controller I have defined the
> following
>     config.columns[:units].options = {:update_column => :amount}
>
> Basically I want to update the value of the amount column based on the
> values of the units column plus another column of the record. However,
> in the after_render_field(record, column) method I don't have access
> to other fields in record apart from units.
>
> ¿Is there any way to overcome this?
> Thanks in advance
> Pedro

If you want to use the value in the form, you can override render_field.js.rjs 
in your controller views directory as:

page << render(:super)
amount_id = active_scaffold_input_options(:amount, params[:scope])[:id]
field_id = active_scaffold_input_options(column, params[:scope])[:id]
page << "$('#{amount_id}').value = $F('#{field_id}') + '#[email protected]}'

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en.

Reply via email to