On Mon, Jan 24, 2011 at 12:45 PM, robo <[email protected]>wrote:

> I've got a sortable list that you can add new elements to dynamically,
> using the prototype helpers (http://api.rubyonrails.org/classes/
> ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/<http://api.rubyonrails.org/classes/%0AActionView/Helpers/PrototypeHelper/JavaScriptGenerator/>
> GeneratorMethods.html)
>
> I want to be able to remove a selected item from the list dynamically
> -- presumably, each item in the list would have a link_to_remote that
> would pop a confirmation dialog, then remove the selected row from the
> list.  When this happens, though, I will need to renumber all the
> other div id's in my list to keep the list in good, numerical order.
>

Why?


>
> Any idea on how to rename a div id in this manner?  I don't want to
> replace the div outright, if possible, as that seems really messy.
>

Just an idea, but maybe you can leave the div's as is --- when you remove a
div then it just disappears, and the visible list order is still preserved.
Then if the user does re-order the list at the ui, then you send ajax on
that event.

>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

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

Reply via email to