javascript - angular-datatables payload format does not change upon subsequent calls to reloadData() -
By using the initial load of data in the table using the angular-datatable (), I want to change the date range for which Reload and display data period is selected using the input field two days from time to time. However, all subsequent requests do not modify the time-line parameters in the The strange thing is that, when I change the modified Example: Whenever I post for new data getting it in the "Networks" tab of "Developers Tools" Although it is the equivalent in the "console" tab, when issuing to rewrite The 'console' tab discussed above causes the production, updating the payload values in all ways, when printed in the "console" tab, but still The request in the "Networks" tab indicates the use of the old deadline values. In fact, you can enter dtOptions obeject.
dtOptions objects, the changes begin to take effect, that is, the data property of
dtOptions Demonstrates the request in the "Networks" tab of "Developer Tools" in Chrome, indicating that the old deadline values are still used, which are not updated in table entries.
is from {to, from} is:
Origin: http: // localhost: 9000 Referer: http: // localhost: 9000 / user-agent: Mozilla / 5.0 (X11, Linux x86_64) ChromeWebKit / 537.36 (KHTML, like Lizard) Chrome / 37.0. 2062.120 Safari / 537.36 Form DataView sourceview URL Encoding - & gt; From: 1412172055200 - & gt; To: 1412690455222
console.log ($ Scope.dtOptions); Really shows me the time frame already selected.
object {ajax: object, reload: true, integrateBootstrap: false, hasColVis: false, hasColReorder: falseĆ¢ ?? |} Ajax: Object Data: Object - & gt; From: 1412518000453 - & gt; To:: 1412690800493 __proto__: Object datatype: "json" type: "post"
with
rewrite and
several methods Trying to do
$ scope.dtOptions.reloadData () : The value written in the payload before calling, written directly to
$ scope.dtOptions.ajax.from , to pass directly Attempted
payload object, and the latest effort (code below to give an idea) updated -
newOptions () to
dtOptions Object again Used to make
var payload = {to: TFRM, from: TTO}; $ Scope.dtOptions = DTOptionsBuilder.newOptions () .withOption ('ajax', {url: constantCfg.apiEndpoint + constantCfg.uri.usersStats, type: 'POST', data: payload}); $ Scope.dtOptions.reloadData (); Console.log ($ scope.dtOptions); & Lt; -
Payload There was no reason to update any additional warnings or errors in the object.
ajax.data as a code Need to define and define your criteria for sending the server.
var = 1412518000453 from = 1412690800493; $ Scope.dtOptions = DTOptionsBuilder.newOptions () .withOption ('ajax', {url: constantCfg.apiEndpoint + constantCfg.uri.usersStats, type: 'receiving' data: function (d) {d.from = to; D .to = to;}}); $ Scope.reloadData = function () {// Calculate the variable from / to your = 1412518000463; From = 1412690800593; $ Scope.dtOptions.reloadData (); };
Comments
Post a Comment