You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to send POST request in asynchronous mode.
data should retrive each page when click pagination.
totalNumber should send by the server.
but, totalNumber is only accept dataSource is URL.
but, URL mode is only GET.
If I want to send POST, must write by function
$(...').pagination({ dataSource: (done) => { return done($.post( 'http://www.com/getpage/1', // retrive data only one page. $(form).serialize()); }, totalNumber: () => { return $.post( 'http://www.com/getTotal', // retrive total number of result. $(form).serialize()); }, callback: (d, p) { ... // display process } });
I am not sure difference between 'totalNumber' and 'totalNumberLocator'.
simple imagination sample code. $('...').pagination({ dataSource: (done) => { // <- if use POST must written by function(). return done([1, 2]); // sample. POST returns [1,2]. total records count is 100. }, totalNumber: 100, // <- if i use dataSource in function, 100 is ignored. totalNumberLoator: 100, // <- this ignore too. callback: (d, p) { ... // display process } });
if i want to send totalNumber, should dataSource in URL.
but, cannot send POST by URL.
$('...').pagination({ dataSource: 'http://xxx.com/yyy/', <- I cannot send POST by URL. totalNumber: 100, // <- totalNumber works. callback: (d, p) { ... // display process } });
I have no idea to send POST request in asynchrounous mode.
I cannot send total data to browser, because too much data.
The text was updated successfully, but these errors were encountered:
I want to send POST request in asynchronous mode.
data should retrive each page when click pagination.
totalNumber should send by the server.
but, totalNumber is only accept dataSource is URL.
but, URL mode is only GET.
If I want to send POST, must write by function
$(...').pagination({
dataSource: (done) => {
return done($.post(
'http://www.com/getpage/1', // retrive data only one page.
$(form).serialize());
},
totalNumber: () => {
return $.post(
'http://www.com/getTotal', // retrive total number of result.
$(form).serialize());
},
callback: (d, p) {
... // display process
}
});
I am not sure difference between 'totalNumber' and 'totalNumberLocator'.
simple imagination sample code.
$('...').pagination({
dataSource: (done) => { // <- if use POST must written by function().
return done([1, 2]); // sample. POST returns [1,2]. total records count is 100.
},
totalNumber: 100, // <- if i use dataSource in function, 100 is ignored.
totalNumberLoator: 100, // <- this ignore too.
callback: (d, p) {
... // display process
}
});
if i want to send totalNumber, should dataSource in URL.
but, cannot send POST by URL.
$('...').pagination({
dataSource: 'http://xxx.com/yyy/', <- I cannot send POST by URL.
totalNumber: 100, // <- totalNumber works.
callback: (d, p) {
... // display process
}
});
I have no idea to send POST request in asynchrounous mode.
I cannot send total data to browser, because too much data.
The text was updated successfully, but these errors were encountered: