Jeditables & Pagination
Jeditables & Pagination
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]
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]
This discussion has been closed.
Replies
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]