Some features in Ruby on Rails 3
Some features in Ruby on Rails 3
Hi,
I'm using dataTables with Ruby on Rails and everything work fine with the tables that I have, but theres one view where I also add some data via ajax
and datatables has an option for that
$('#lista1').dataTable().fnAddData( [] );
but when I show mi tables I'm using partials (from Rails), and that partial shows the entire row, not each col of that row.
Is there a way of adding that partial into a datatable row? because when I do
$('#lista1').dataTable().fnAddData( [
"<%= escape_javascript(render 'partial', :f => f)%>"
]);
it inserts only in the first col (wich is the expected behaviour).
Thanks in advance
Javier Q
I'm using dataTables with Ruby on Rails and everything work fine with the tables that I have, but theres one view where I also add some data via ajax
and datatables has an option for that
$('#lista1').dataTable().fnAddData( [] );
but when I show mi tables I'm using partials (from Rails), and that partial shows the entire row, not each col of that row.
Is there a way of adding that partial into a datatable row? because when I do
$('#lista1').dataTable().fnAddData( [
"<%= escape_javascript(render 'partial', :f => f)%>"
]);
it inserts only in the first col (wich is the expected behaviour).
Thanks in advance
Javier Q
This discussion has been closed.
Replies
Having said that what you could do is simply create an array of the required length with empty strings in the locations where you don't currently have the information available.
Allan
I thought so.... seems that dataTables won't let me do that
I tried by writing the rails code inside the code that I mentioned, but seems that there's a lot of quotes ( " " ' ' )
and the javascript won't accept them.
Maybe there's a way of including code on each col of the datatable row I want to add
Javier