Laravel 5.1 datatables reorder row
<p>I need help.</p>

<p>I'm using yajra/laravel-datatables for include datatables into my project.</p>

<p>All is working.</p>

<p>Now I want to use the row reorder extension: <a href="https://datatables.net/extensions/rowreorder/" rel="nofollow">https://datatables.net/extensions/rowreorder/</a></p>

<p>But when I make a drag and drop with a row seems to work, but is not working.</p>

<p>I think is possible that is reloaded because I use ajax url to load data, unmaking the reorder I do. Is possible?</p>

<p>Well, these are my codes:</p>

<p>Controller:</p>

<pre><code>/**
 * Display a listing of the resource.
 *
 * @return \Illuminate\Http\Response
 */
public function index()
{
    $med = new Medicinas;

    return view('admin.medicinas.index', ['med' =&gt; $med-&gt;get()]);
}

/**
 * Process datatables ajax request.
 *
 * @return \Illuminate\Http\JsonResponse
 */
public function anyData()
{
    return Datatables::of(User::select('*'))-&gt;make(true);
}
</code></pre>

<p>Routes:</p>

<pre><code>Route::get('administrator/medicinas', [
        'as' =&gt; 'admin.medicinas',
        'uses' =&gt; 'MedicinasController@index'
    ]);

Route::controller('administrator/medicinas', 'MedicinasController', [
        'anyData'  =&gt; 'datatables.data',
        'index' =&gt; 'administrator/medicinas',
    ]);
</code></pre>

<p>View:</p>

<pre><code>@extends('app')

@section('content')
&lt;div class="col-xs-12 col-sm-10"&gt;
    @foreach($med as $medicina)
        &lt;div class="col-xs-12 col-sm-4"&gt;
            &lt;a href="{{ route('medicina.edit', $medicina-&gt;id) }}" title=""&gt;{{ $medicina-&gt;nombre_comercial }}&lt;/a&gt;
        &lt;/div&gt;
    @endforeach
&lt;/div&gt;

&lt;table id="users-table" class="table table-striped table-bordered" cellspacing="0" width="100%"&gt;
    &lt;thead&gt;
        &lt;tr&gt;
            &lt;th&gt;Id&lt;/th&gt;
            &lt;th&gt;Name&lt;/th&gt;
            &lt;th&gt;Email&lt;/th&gt;
            &lt;th&gt;Created At&lt;/th&gt;
            &lt;th&gt;Updated At&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tfoot&gt;
        &lt;tr&gt;
            &lt;th&gt;Id&lt;/th&gt;
            &lt;th&gt;Name&lt;/th&gt;
            &lt;th&gt;Email&lt;/th&gt;
            &lt;th&gt;Created At&lt;/th&gt;
            &lt;th&gt;Updated At&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/tfoot&gt;
&lt;/table&gt;
&lt;input type="text" name="" value="" placeholder=""&gt;
@endsection

@section('scripts')
&lt;script type="text/javascript"&gt;
    $(function() {
        var table_id = '#' + 'users-table';

        window.table = $(table_id).DataTable({
            rowReorder: true,
            processing: true,
            serverSide: true,
            ajax: '{!! route('datatables.data') !!}',
            columns: [
                { data: 'id', name: 'id' },
                { data: 'name', name: 'name' },
                { data: 'email', name: 'email' },
                { data: 'created_at', name: 'created_at' },
                { data: 'updated_at', name: 'updated_at' }
            ]
        });

        window.table_h = $(table_id + ' thead th');
        window.table_f = $(table_id + ' tfoot th');
    });
&lt;/script&gt;
@endsection
</code></pre>