I am working on a search page where search results will get displayed in a grid. I have a search button that will trigger the to execute http call to the server to retrieve the data. However, only when for the first time search button clicked request gets sent once, every subsequent click two requests are being sent. I am out of ideas what is causing this.
Here is the code that gets executed once each time search button is clicked:
$scope.gridData = new kendo.data.DataSource({
transport: {
read: function (e) {
$http.post('/Provider/ProviderSearchResult', angular.toJson(dataTransferObject))
.then(function success(response) {
e.success(response.data);
console.log("success: " + response.data);
}, function error(response) {
alert('something went wrong')
console.log("error: " + response);
})
},
},
pageSize: 10,
sort: { field: "rating", dir: "desc" },
});
Any help would be appreciated. Thank you.