Sha256: 43e470f39d3340e2561c307e05f3bc1b48040cde8fb81d8c44c40d9116a9dbb6

Contents?: true

Size: 998 Bytes

Versions: 4

Compression:

Stored size: 998 Bytes

Contents

form_selector = "#{element_form_id(:action => :batch_create)}"

if controller.send :batch_successful?
  called_by_controller = params.delete(:batch_create_by)
  if called_by_controller.nil?
    page.call 'ActiveScaffold.replace_html', active_scaffold_content_id, render(:partial => 'list', :layout => false)
  else
    options = {:checked => false,
               :include_mark_all => false}
    tbody_id = "#{controller_id(called_by_controller)}-tbody"
    page << "ActiveScaffold.mark_records('#{tbody_id}', #{options.to_json});"
  end
  page << "ActiveScaffold.find_action_link('#{form_selector}').close();"
else
  page << "ActiveScaffold.find_action_link('#{form_selector}').update_flash_messages('#{escape_javascript(render(:partial => 'messages').strip)}');"
  page.call 'ActiveScaffold.replace', form_selector, render(:partial => 'batch_create_form', :locals => {:xhr => true})
  page.call 'ActiveScaffold.scroll_to', form_selector
  #have to uncheck successfully created marked_records
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_scaffold_batch_vho-3.0.6 frontends/default/views/on_batch_create.js.rjs
active_scaffold_batch_vho-3.0.5 frontends/default/views/on_batch_create.js.rjs
active_scaffold_batch_vho-3.0.4 frontends/default/views/on_batch_create.js.rjs
active_scaffold_batch_vho-3.0.3 frontends/default/views/on_batch_create.js.rjs