Server side start with twice request
See original GitHub issueI’m using with server side processing and when it initializes, the request to server is duplicated.
<table datatable dt-options="dtOptions" dt-columns="dtColumns"></table>
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withOption('ajax', { url: String.format('{0}api/System/Message/Get', BASEURL) })
.withDataProp('data')
.withOption('serverSide', true)
.withOption('processing', true)
.withOption('order', [[0, 'asc'], [1, 'asc']])
.withBootstrap();
$scope.dtColumns = [
DTColumnBuilder.newColumn('cdMessage').withTitle('Id').withOption('width', 110),
DTColumnBuilder.newColumn('cdCulture').withTitle('Culture').withOption('width', 100),
DTColumnBuilder.newColumn('tpMessage').withTitle('MessageType').withOption('width', 160),
DTColumnBuilder.newColumn('dsMessage').withTitle('MessageDescription'),
DTColumnBuilder.newColumn('dsDetails').withTitle('MessageDetails')
];
Issue Analytics
- State:
- Created 9 years ago
- Comments:23 (4 by maintainers)
Top Results From Across the Web
Server-side redirect without calling GET twice - Stack Overflow
1 Answer 1 · fetch makes a POST request to /page-1 · The server responds saying "You need to get page-2 instead" ·...
Read more >Can an HTTPS request be sent twice?
Since a successfully replayed packet essentially means that an attacker was able to actively fiddle with the underlying reliable TCP connection, ...
Read more >AXIOS sending Request Twice - Laracasts
I send a POST request to a API server and the request sent 2 times. The initial request succeed because the records are...
Read more >load from +page.ts called twice - why? : r/sveltejs - Reddit
As the title says: I have a setup that has some code in a +page.ts , that fetches some data from an API....
Read more >Server script runs twice with AngularJS directive - ServiceNow
... of the widget/button to depend on the result of a server-side call. ... the angular directive causes the server script to run...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, I’m seeing the same issue in v0.4.3.
It is because of the promises.
In the first load of your page, you must set the
tableOptions
andtableColumns
with an empty promise.This is what I noticed, if the DOM is not yet ready, the tableOptions will attempt to call for an ajax request, but since the
<table datatable
is not yet present, it will not do anything, you just be able to see the request first hand, then after the DOM is loaded, then thedatatable
directive will start the tableOptions to call for an ajax request, that is why there are two requests after the page load.