I used laravel 4.2 billam Server side Datatable, and now it' works. But I can't add Edit and Remove Button in this datatable.
View page :
<script type="text/javascript">
var oTable;
$(document).ready(function() {
oTable = $('#tasks').dataTable( {
"sPaginationType": "bootstrap",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "{{ URL::to('/task') }}"
});
});
Route :
Route::get('/task',function(){
$posts = Campaigns::select(array('title','created_at','status'));
return Datatables::of($posts)
->make();
});
Now how can I add Delete and edit button ? I am follow there documentation from here that not works for me.
Documented Example 2: Adding and editing columns
->add_column('operations', '<a href="{{ URL::route( \'admin.post\', array( \'edit\',$id )) }}">edit</a>
<a href="{{ URL::route( \'admin.post\', array( \'delete\',$id )) }}">delete</a>
')
->edit_column('status', '{{ $status ? 'Active' : 'Passive' }}')
->edit_column('ownername', function($row) {
return "The author of this post is {$row->ownername}";
})
But how can I use blade structured code in route or controller? it's make little confusion..