I'm trying to implement ordering functionality in datatable. Requirement is simple, when a user drag a row for repositioning the respective row position/order field value should be incremented/decremented respectively in database!

I tried the below but sortable function is just fetching the 1st 10 entries ids from the DataTable in parameters variable.

How can I get all the available entries ids from the datatable in my params variable. The DataTable is in paginated form so I want to get all the records ids in parameters variable when someone is reordering records in DataTable.

// The below functionality is for ordering categories
var $sortable = $( ".resources-categories-table > tbody" );
    stop: function ( event, ui ) {
        var parameters = $sortable.sortable( "toArray", { attribute: 'data-id' });
            url: '<?php echo $this->CxHelper->Route('eb-admin-change-resource-category-order')?>',
            type: 'POST',
            data: { values: parameters },
            success: function (data) {


public function changeResourceCategoryOrderAction() {
    $values = $this->request->get( 'values', null );

0 Answers