How to bind loaded data to datatable???
How to bind loaded data to datatable???
AmirSarvestani
Posts: 5Questions: 2Answers: 0
I am trying to load a json which is a servlet response made by "ObjectMapper mapper" . All i do is submit a button which send a Post to a servlet and the response is a Json created by Hackson FasterXmL. I want to update the table when I get the response but have had no luck populating the table. Can Anyone Pleeease help me??
This discussion has been closed.
Answers
$scope.sendPost = function () {
$http({
url: './servlets/SearchCustomerServlet',
method: "POST",
data: {
'businessName': $scope.businessName,
'lastName': $scope.lastName,
'emailAddress': $scope.emailAddress,
'mobileNumber': $scope.mobileNumber
}
}).then(function (data) {
This is my Angular Post
function updateTable(dataitems) {
$('#myTable').DataTable({
"data" data,
"columns": [
{"data": "firstName"},
{"data": "lastName"}
]
});
}
This is how I update the table. Please any help is much appreciated.