I'm using array of objects - convert list of objects using GSON. In debug console it looks like this
but I've got an error -
P.S. An interesting thing - when I move ajax to .txt and read it using example with deep.txt - it works correctly
Also a question
{ "aaData" : [ { "email":"EEE", "login": "log1", "password" : "a235123151312", "id" : 1 }, { "email":"EEE", "login": "log2", "password" : "a235123151312", "id" : 1 } ]}my datatable looks like this
var oTable1 = $('#usertable').dataTable({ "sPaginationType": "bs_full", "bProcessing" : true, "sAjaxSource" : "/loadusers.html", "aoColumns": [ { "mData" : "email" }, { "mData" : "login" }, { "mData" : "password" }, { "mData" : "id" } ], fnRowCallback: function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { $(nRow).on('click', function() { if ($(nRow).hasClass('info')) $(nRow).removeClass('info'); else { var arr = oTable1.fnGetNodes(); for (var i = 0; i < arr.length; i++) { if ($(arr[i]).hasClass('info')) $(arr[i]).removeClass('info'); //one row per time } $(nRow).addClass('info'); } }); } });with html
<table class="datatable table table-striped table-bordered" id="usertable"> <thead> <th>Email</th> <th>Login</th> <th>Password</th> <th>ID</th> </thead> <tbody></tbody> </table>
but I've got an error -
DataTables warning (table id = 'usertable'): Requested unknown parameter '0' from the data source for row 0and it shows several rows but without any data.
P.S. An interesting thing - when I move ajax to .txt and read it using example with deep.txt - it works correctly
Also a question
how to ignore a column - for example password