Ajax list removal


#1

I have a list of objects that are in a table. Each row of the table
contains the elements of one object. The rows have dynamically
generated id’s based on the object.

I’ve created a destroy method for these objects, but I am not sure what
to put in the rjs to remove the object from the list.


#2

Hi David,

David M. wrote:

I have a list of objects that are in a table. Each row of the table
contains the elements of one object. The rows have dynamically
generated id’s based on the object.

I’ve created a destroy method for these objects, but I am not sure what
to put in the rjs to remove the object from the list.

If you’re using tables, as in

, you’ll be very limited to what
you
can do with Ajax. Best bet is to just re-render the table.

hth,
Bill


#3

On Jun 2, 6:49 pm, David M. <rails-mailing-l…@andreas-
s.net> wrote:

I have a list of objects that are in a table. Each row of the table
contains the elements of one object. The rows have dynamically
generated id’s based on the object.

I’ve created a destroy method for these objects, but I am not sure what
to put in the rjs to remove the object from the list.

I’ve developed an app that can delete table rows with an Ajax call. I
wrote a javascript delete function and call it from rjs. The script
ultimately uses the built-in remove method:

$(‘my_row_id’).remove();

Since you’ve written your own method, have you tried simply:

page['my_row_'id].destroy

in your rjs?