After a DB call to retrieve the dataset into listAction, the jtable open up but doesn't load the data into the rows, it only create the html tag but without the data. Found nothing on internet, hope in some help :)
JS code inside function
$('#dialogTest').jtable({
title: 'Test',
paging: true,
pageSize: 10,
sorting: true,
multiSorting: true,
defaultSorting: 'functionName ASC',
actions: {
listAction: function () {
return $.Deferred(function ($dfd) {
$.ajax({
url: ***"DB CALL PATH"***,
type: 'POST',
dataType: 'json',
data: { "data": JSON.stringify(data) },
success: function (data) {
$dfd.resolve(data)
},
error: function () {
$dfd.reject();
}
});
});
},
fields: {
functionName: {
title: 'functionName',
type: 'string',
},
missingIn: {
title: 'missingIn',
type: 'string',
},
app: {
title: 'app',
type: 'string',
},
filePath: {
title: 'filePath',
type: 'string'
}
},
close: function () {
$(this).remove();
},
buttons: [{
text: "Close",
id: 'btnCloseAnalyzer',
click: function () {
$(this).dialog("close");
}
}]
}
})
//Load student list from server
$('#dialogTest').jtable('load');
}
})
}
Data from DB
{
"Result": "OK",
"Records": [
{
"functionName": "functionTest1",
"app": "x",
"filePath": "#######.js",
"missingIn" : "y"
//other data not specified because worthless
},
{
"functionName": "functionTest2",
"app": "xx",
"filePath": "#######.js",
"missingIn": "yy",
//other data not specified because worthless
}
],
"TotalRecordCount": "0"
}
html created with empty row
<table class="jtable">
<thead>
<tr></tr>
</thead>
<tbody>
<tr class="jtable-data-row jtable-row-even"></tr>
<tr class="jtable-data-row"></tr>
<tr class="jtable-data-row jtable-row-even"></tr>
<tr class="jtable-data-row"></tr>
</tbody>
</table>
As you can see even if the object structure and valorization are in the same format as described in jtable documentation, it only creates the html structure without the data in it. Any ideas ?