Hi:
I have created "lock" and "unlock" custom actions in the
activescaffold. Lock action will disable all other record update and
delete action and while unlock action will do the reverse. These two
action are setup as ajax actions as following:
config.action_links.add( ' Unlock',
:type => :record,
:position => false,
:inline => true,
:security_method
=> :authorized_for_unlock?,
:crud_type => :create,
:action =>"unlock",
:page => false,
:html_options => { :title=>"Unlock
Record"})
The enabling and disabling of the actions are controlled by the model
security methods.
the rjs template for both actions are as following:
page.replace element_row_id(:action => 'list', :id =>
@record.id), :partial => 'list_record', :locals => {:record =>
@record}
page.replace_html active_scaffold_messages_id, :partial => 'messages'
So far the setup seems to work fine. Two custom actions works as
expected.
The problem I have is that, after execute Unlock action, the Edit
action (ajax) no longer work. The default ajax Edit action will
disable the "Edit" label first and display the edit form. But after
unlock that refreshes the record, the Edit action only disable the
"Edit" label and does not display the edit form.
I have traced the error occurred in active_scaffold.js. The error
occurred when executing "new Insertion.After(this.target, content);".
I modified the javascript and It generated the following error in
firebug.
fileName "http://192.168.74.138:3001/javascripts/prototype.js?
1275958012"
lineNumber 1653
message "element is null"
name "TypeError"
stack "([object HTMLTableRowEl...ent([object Event])@:0\ .......
Does anyone have idea on how to resolve this? Any help will be greatly
appreciated.
Thanks
Jefflin
--
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.