Jeditables & Pagination

Jeditables & Pagination

ange0223ange0223 Posts: 2Questions: 0Answers: 0
edited February 2014 in General
Hi I'm having some issues with pagination. When I have pagination set to false I can easily edit all of the records and it updates the database.

However, when I change pagination to true I can only edit records on the first page. All other pages I am unable to edit. Please help!

Below is my code:

[code]
$(document).ready( function () {

/* Sets row moving and column select */

$('#attendees').dataTable( {
"bPaginate": false,
"sDom": 'R C<"clear">lfrtip',
"oColVis": {
"aiExclude": [ 0 ]
},
"oColReorder": {
"iFixedColumns": 1
}
} );



var oTable = $('#attendees').dataTable();
var id = $(this).parents('tr').attr('id');
var url = "./save_row"



$('td.editable').each(function(i) {

var current_id = $(this).parents('tr').attr('id');
var current_field = $(this).attr('id');

var current_value = oTable.fnGetData( this )

$(this).editable(url, {
type :'text',
cancel : 'Cancel',
submit : 'OK',
indicator : 'Saving...',
tooltip : 'Click to edit...',
submitdata : { id : current_id, authenticity_token:AUTH_TOKEN, "field_name": current_field }
});
});
});
[/code]

Replies

  • ange0223ange0223 Posts: 2Questions: 0Answers: 0
    I've tried fnDrawCallback but if I use that then I can't get the variables from the td I need to submit.

    Below is what I tried

    [code]

    "fnDrawCallback": function (){


    $('#attendees tbody td.editable').editable(url, {
    type :'text',
    cancel : 'Cancel',
    submit : 'OK',
    indicator : 'Saving...',
    tooltip : 'Click to edit...',
    submitdata : { id : $('td.editable').parents('tr').attr('id') , authenticity_token:AUTH_TOKEN, "field_name": $('td.editable').attr('id')}
    })
    },
    [/code]
This discussion has been closed.