Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with view datatables (show as array not tables)? #176

Open
thearabbit opened this issue Nov 20, 2014 · 4 comments
Open

problem with view datatables (show as array not tables)? #176

thearabbit opened this issue Nov 20, 2014 · 4 comments
Labels

Comments

@thearabbit
Copy link

I am new for this package.
I try test, and then it is show:
HTTP/1.0 200 OK Cache-Control: no-cache Content-Type: application/json Date: Thu, 20 Nov 2014 04:00:03 GMT {"sEcho":0,"iTotalRecords":28,"iTotalDisplayRecords":28,"aaData":[[1,"super","cpanel"],[2,"Admin","cpanel"],[3,"Test","sample"],[7,"Loan","loan"],[8,"asd","sample"],[9,"dsfasdf","sample"],[10,"fdg","loan"],[11,"dsfgdfsg","sample"],[12,"fdgsfg","loan"],[13,"fgfg","loan"],[14,"dfa","sample"],[15,"fdgfd","sample"],[16,"dffs","loan"],

@thearabbit thearabbit changed the title problem with view datatables (array show)? problem with view datatables (show as array not tables)? Nov 20, 2014
@MarkVaughn
Copy link
Contributor

This looks right, the purpose of this package is to work with http://datatables.net/
So you need to setup the front-end html, css and javascript to render

@thearabbit
Copy link
Author

I added all of asset of datatables already, but don't show.
Pleas example for me.

@tuyenlaptrinh
Copy link

I have same problem. Please help us
My script
$("#user-list").dataTable({
"processing": true,
"serverSide": true,
"ajax": "demo.php",
"order": [[1,'desc']],
"columnDefs": [ {
"targets": "_all",
"defaultContent": ""
} ],
"columns": [
{ "data" : "id", "title" : "Id", "orderable": true, "searchable": false },
{ "data" : "username", "title" : "Username", "orderable": true, "searchable": true },
{ "data" : "email", "title" : "Email", "orderable": true, "searchable": true },
]
});

I user datatables 1.10.4 don't show text, but i see row
capture
My result ajax
{"sEcho":0,"iTotalRecords":1,"iTotalDisplayRecords":1,"aaData":[[1,"admin","[email protected]"]],"sColumns":["id","username","email"]}

I try use datatables 1.9.x but error
I try edit output to
{data:[[1,"admin",""[email protected]]]}
But still error
Sorry for my english

@tuyenlaptrinh
Copy link

I fixed it.
Change data to aaData

$("#user-list").dataTable({
"processing": true,
"serverSide": true,
"ajax": "demo.php",
"order": [[1,'desc']],
"columnDefs": [ {
"targets": "_all",
"defaultContent": ""
} ],
"columns": [
{ "aaData" : "id", "title" : "Id", "orderable": true, "searchable": false },
{ "aaData" : "username", "title" : "Username", "orderable": true, "searchable": true },
{ "aaData" : "email", "title" : "Email", "orderable": true, "searchable": true },
]
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants