public Method

ScriptaculousHelper.sortable_element_js(element_id, options = {})

There's no documentation for this item.

Source Code

# File action_view/helpers/scriptaculous_helper.rb, line 142
def sortable_element_js(element_id, options = {}) #:nodoc:
  options[:with]     ||= "Sortable.serialize(#{element_id.to_json})"
  options[:onUpdate] ||= "function(){" + remote_function(options) + "}"
  options.delete_if { |key, value| PrototypeHelper::AJAX_OPTIONS.include?(key) }

  [:tag, :overlap, :constraint, :handle].each do |option|
    options[option] = "'#{options[option]}'" if options[option]
  end

  options[:containment] = array_or_string_for_javascript(options[:containment]) if options[:containment]
  options[:only] = array_or_string_for_javascript(options[:only]) if options[:only]

  %(Sortable.create(#{element_id.to_json}, #{options_for_javascript(options)});)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.