Support the ongoing development of Laravel.io →
Database Views Laravel.io

Hi,

I am using bllim\laravel4-datatables-package using the tutorial in the below link, I am able to get JSON output directly. This is a link

When I access the View, It shows only --- The table header along with processing message

When I click the "No. Page Entries(dropdown)" and then gets error ** Invalid JSON Resposne and then data's to the table is loaded

It doesn't loads the Data to the Table on First

Route

Route::get('admin/memberslist', array('as' => 'memberslist', 'uses' => 'OrdersController@memberslist'));

Method

public function memberslist()
	{
		$pages = Orders::select(array('id','name','email','updated_at'));
		return Datatables::of($pages)
			->make();
	}

JS

$('#articles').dataTable( {
	"bProcessing": true,
	"bServerSide": true,
	"sAjaxSource": "admin/memberslist",
	"aaSorting": [[ 3, "desc" ]],
	"aoColumns": [
            { 'sWidth': '60px' },
            { 'sWidth': '130px', 'sClass': 'center' },
            { 'sWidth': '180px', 'sClass': 'center' },
            { 'sWidth': '60px', 'sClass': 'center' },
        ]
});

HTML

<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-condensed table-bordered" id="articles">
	<thead>
		<tr>
			<th>ID</th>
			<th>name</th>
			<th>Email</th>
			<th>Created At</th>
		</tr>
	</thead>
	<tbody>
		<tr>			
			<td></td>
			<td></td>
			<td></td>			
			<td></td>
		</tr>
	</tbody>
</table>
Last updated 3 years ago.
0

Why aren't you using regular HTML tables, where you have full control on all?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

jaiimg jaiimg Joined 7 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.