I have two side by side lists on a page, form__list1 and form__list2.
I want to drag ffrom list 1 to list 2. I am terribly confused on what
I must set up to make this drag and drop with Scritpaculous occur (and
where — do I put things in my views, shown below, or the
helpers…or the controller). I know how to get the values from
form__list2 in my controller…I just need to know what to put in
(and where) to make the DnD via scriptaculus occur here. Thanks,
Janna, view below:
<% form__list1 = [] %>
<% form__list1selected = [] %>
<% options_for_select_hash = [] %>
<% options_for_select_hash = Associate.find(:all, :order =>
'username ASC', :conditions => ["deleted=0 and (branch like ? or ?
like branch)", @channel.defbranchcode,
@channel.defbranchcode]).collect {|p| [ p.username, p.id ]} %>
<%= select_tag('form__list1[]', options_for_select
(options_for_select_hash, form__list1selected
[options_for_select_hash.length]), html_options = {"size" => 15,
"multiple" => true, :style => "width:200px"}) %>
<% form__list2 = [] %>
<% form__list2selected = [] %>
<%= select_tag('form__list2[]', options_for_select([],
form__list2selected[options_for_select_hash.length+Associate.find
(:all, :conditions => ["deleted=0"]).length]), html_options = {"size"
=> 15, "multiple" => true, :style => "width:200px" }) %>