rowReorder using serverSide
rowReorder using serverSide
Hello,
I have been trying to get the rowReorder plug-in working along with server side querying in my dataTables.
The JS being used is as follows:
$detailsTable.dataTable({
serverSide: true,
ajax: {
url: '<?=base_url()?>ajax/get-template-details',
type: 'POST',
data: {
screenID: '<?=$screen->screenID ?>',
templateType: '<?=$screen->templateID ?>'
}
},
columns: [
{ data: 'templateDetailsID', visible: false },
{ data: 'myOrder' },
<?php foreach($detailsColumns as $column) : ?>
{ data: '<?=$column['name'] ?>' },
<?php endforeach; ?>
],
rowReorder: {
dataSrc: 'myOrder'
},
processing: true,
paging: false
});
The AJAX call is being handled with CodeIgniter, using a custom library (which I found here: https://github.com/zepernick/Codeigniter-DataTables). Dumping the POST data on the AJAX call shows no difference between the initial table draw (when the page is loaded) and the redraw event when the row order is changed, so the POST request seems to send no extra parameters to reflect the changes.
What am I missing? Is this feature only available with the Editor library?
Answers
I should also note I have tried using the "on('row-reorder', ..." event, which doesn't fire at all for some reason.
Hi, did you ever come to a solution?
I am trying to use the editor with rowReorder extension, but AJAX is not being submitted to my php controller. I am using the following:
.on('postCreate postRemove', function() {
console.log('postCreate postRemove');
datatable.ajax.reload(null, false);
}).on('initCreate', function() {
console.log('initCreate');
editor.field('position').enable();
}).on('initEdit', function() {
console.log('initEdit');
editor.field('position').disable();
});
Reordering works great, but the editor is not being called. Thanks