Can ajaxProgressiveLoad work with Overriding the Request Promise in Tabulator










-1















It did work with pagination: "remote", but **some kind of reason that we have to use customize ajax function in .net ** but not ajaxURL option.



Is that a feature request? Thanks for help in advance.




Here are the following code:



  • pagination: "remote" with customize ajax(It works)

<script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
<link href="https://unpkg.com/tabulator-tables@4.1.2/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@4.1.2/dist/js/tabulator.min.js"></script>
<script>
function queryRealm(url, config, params)
return new Promise(function (resolve, reject)
$.ajax(
url: 'data.php',
success: function(data)
resolve(JSON.parse(data));
,
error: function(error)
reject(error);

)
);


var table = new Tabulator("#example-table",
ajaxRequestFunc: queryRealm,
pagination: 'remote',
columns: [
title: "id",
field: "id",
,

title: "Name",
field: "name",
width: 200

],
height: "292px",
);





  • ajaxProgressiveLoad: "scroll" with customize ajax(It doesn't work)

just change pagination: 'remote', to ajaxProgressiveLoad: "scroll"






And data.php is following:



$data = [
["id"=>1, "name"=>"Billy Bob============"],
["id"=>2, "name"=>"Mary May"],
["id"=>3, "name"=>"Christine Lobowski"],
["id"=>4, "name"=>"Brendon Philips"],
["id"=>5, "name"=>"Margret Marmajuke"],
["id"=>6, "name"=>"Christine Lobowski"],
["id"=>7, "name"=>"Brendon Philips"],`enter code here`
["id"=>8, "name"=>"Margret Marmajuke"],
["id"=>9, "name"=>"Margret Marmajuke"],
];

echo(json_encode(["last_page"=>10, "data"=>$data]));



updated an image
enable ajaxUrl option










share|improve this question
























  • You request is a bit vauge im afraid. i would recommend including a copy of your table constructor object so we can better understand how your table is setup.

    – Oli Folkerd
    Nov 15 '18 at 8:08











  • @OliFolkerd Hi Oil, just edit the question yet, thanks for remind.

    – 袁伟麟
    Nov 16 '18 at 2:28















-1















It did work with pagination: "remote", but **some kind of reason that we have to use customize ajax function in .net ** but not ajaxURL option.



Is that a feature request? Thanks for help in advance.




Here are the following code:



  • pagination: "remote" with customize ajax(It works)

<script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
<link href="https://unpkg.com/tabulator-tables@4.1.2/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@4.1.2/dist/js/tabulator.min.js"></script>
<script>
function queryRealm(url, config, params)
return new Promise(function (resolve, reject)
$.ajax(
url: 'data.php',
success: function(data)
resolve(JSON.parse(data));
,
error: function(error)
reject(error);

)
);


var table = new Tabulator("#example-table",
ajaxRequestFunc: queryRealm,
pagination: 'remote',
columns: [
title: "id",
field: "id",
,

title: "Name",
field: "name",
width: 200

],
height: "292px",
);





  • ajaxProgressiveLoad: "scroll" with customize ajax(It doesn't work)

just change pagination: 'remote', to ajaxProgressiveLoad: "scroll"






And data.php is following:



$data = [
["id"=>1, "name"=>"Billy Bob============"],
["id"=>2, "name"=>"Mary May"],
["id"=>3, "name"=>"Christine Lobowski"],
["id"=>4, "name"=>"Brendon Philips"],
["id"=>5, "name"=>"Margret Marmajuke"],
["id"=>6, "name"=>"Christine Lobowski"],
["id"=>7, "name"=>"Brendon Philips"],`enter code here`
["id"=>8, "name"=>"Margret Marmajuke"],
["id"=>9, "name"=>"Margret Marmajuke"],
];

echo(json_encode(["last_page"=>10, "data"=>$data]));



updated an image
enable ajaxUrl option










share|improve this question
























  • You request is a bit vauge im afraid. i would recommend including a copy of your table constructor object so we can better understand how your table is setup.

    – Oli Folkerd
    Nov 15 '18 at 8:08











  • @OliFolkerd Hi Oil, just edit the question yet, thanks for remind.

    – 袁伟麟
    Nov 16 '18 at 2:28













-1












-1








-1








It did work with pagination: "remote", but **some kind of reason that we have to use customize ajax function in .net ** but not ajaxURL option.



Is that a feature request? Thanks for help in advance.




Here are the following code:



  • pagination: "remote" with customize ajax(It works)

<script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
<link href="https://unpkg.com/tabulator-tables@4.1.2/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@4.1.2/dist/js/tabulator.min.js"></script>
<script>
function queryRealm(url, config, params)
return new Promise(function (resolve, reject)
$.ajax(
url: 'data.php',
success: function(data)
resolve(JSON.parse(data));
,
error: function(error)
reject(error);

)
);


var table = new Tabulator("#example-table",
ajaxRequestFunc: queryRealm,
pagination: 'remote',
columns: [
title: "id",
field: "id",
,

title: "Name",
field: "name",
width: 200

],
height: "292px",
);





  • ajaxProgressiveLoad: "scroll" with customize ajax(It doesn't work)

just change pagination: 'remote', to ajaxProgressiveLoad: "scroll"






And data.php is following:



$data = [
["id"=>1, "name"=>"Billy Bob============"],
["id"=>2, "name"=>"Mary May"],
["id"=>3, "name"=>"Christine Lobowski"],
["id"=>4, "name"=>"Brendon Philips"],
["id"=>5, "name"=>"Margret Marmajuke"],
["id"=>6, "name"=>"Christine Lobowski"],
["id"=>7, "name"=>"Brendon Philips"],`enter code here`
["id"=>8, "name"=>"Margret Marmajuke"],
["id"=>9, "name"=>"Margret Marmajuke"],
];

echo(json_encode(["last_page"=>10, "data"=>$data]));



updated an image
enable ajaxUrl option










share|improve this question
















It did work with pagination: "remote", but **some kind of reason that we have to use customize ajax function in .net ** but not ajaxURL option.



Is that a feature request? Thanks for help in advance.




Here are the following code:



  • pagination: "remote" with customize ajax(It works)

<script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
<link href="https://unpkg.com/tabulator-tables@4.1.2/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables@4.1.2/dist/js/tabulator.min.js"></script>
<script>
function queryRealm(url, config, params)
return new Promise(function (resolve, reject)
$.ajax(
url: 'data.php',
success: function(data)
resolve(JSON.parse(data));
,
error: function(error)
reject(error);

)
);


var table = new Tabulator("#example-table",
ajaxRequestFunc: queryRealm,
pagination: 'remote',
columns: [
title: "id",
field: "id",
,

title: "Name",
field: "name",
width: 200

],
height: "292px",
);





  • ajaxProgressiveLoad: "scroll" with customize ajax(It doesn't work)

just change pagination: 'remote', to ajaxProgressiveLoad: "scroll"






And data.php is following:



$data = [
["id"=>1, "name"=>"Billy Bob============"],
["id"=>2, "name"=>"Mary May"],
["id"=>3, "name"=>"Christine Lobowski"],
["id"=>4, "name"=>"Brendon Philips"],
["id"=>5, "name"=>"Margret Marmajuke"],
["id"=>6, "name"=>"Christine Lobowski"],
["id"=>7, "name"=>"Brendon Philips"],`enter code here`
["id"=>8, "name"=>"Margret Marmajuke"],
["id"=>9, "name"=>"Margret Marmajuke"],
];

echo(json_encode(["last_page"=>10, "data"=>$data]));



updated an image
enable ajaxUrl option







tabulator






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 '18 at 1:50







袁伟麟

















asked Nov 15 '18 at 6:56









袁伟麟袁伟麟

133




133












  • You request is a bit vauge im afraid. i would recommend including a copy of your table constructor object so we can better understand how your table is setup.

    – Oli Folkerd
    Nov 15 '18 at 8:08











  • @OliFolkerd Hi Oil, just edit the question yet, thanks for remind.

    – 袁伟麟
    Nov 16 '18 at 2:28

















  • You request is a bit vauge im afraid. i would recommend including a copy of your table constructor object so we can better understand how your table is setup.

    – Oli Folkerd
    Nov 15 '18 at 8:08











  • @OliFolkerd Hi Oil, just edit the question yet, thanks for remind.

    – 袁伟麟
    Nov 16 '18 at 2:28
















You request is a bit vauge im afraid. i would recommend including a copy of your table constructor object so we can better understand how your table is setup.

– Oli Folkerd
Nov 15 '18 at 8:08





You request is a bit vauge im afraid. i would recommend including a copy of your table constructor object so we can better understand how your table is setup.

– Oli Folkerd
Nov 15 '18 at 8:08













@OliFolkerd Hi Oil, just edit the question yet, thanks for remind.

– 袁伟麟
Nov 16 '18 at 2:28





@OliFolkerd Hi Oil, just edit the question yet, thanks for remind.

– 袁伟麟
Nov 16 '18 at 2:28












1 Answer
1






active

oldest

votes


















0














That should work as long as your are formatting your returned data in the paginated form that Tabulator is expecting:




"last_page":15, //the total number of available pages (this value must be greater than 0)
"data":[ // an array of row data objects
"id":1, "name":"bob", "age":"23" //example row data object
]



and you are correctly passing the page parameter back to your server.



Though looking at the ajaxRequestFunc it is not doing anything that the built in ajax system dosnt already do (especially since its improvements in v4.1) so im not sure why it is needed in the first place.



You will need to make sure the ajaxURL option has a value in order for your custom loader to be called






share|improve this answer

























  • Hi Oli, I found if I enable ajaxUrl with not an empty string, it works. but I don't know is that a good practice in Tabulator. I have updated my question for an image.

    – 袁伟麟
    Nov 26 '18 at 1:49











  • Side note I found the following config is also 4 times request to data.php as the picture. ajaxRequestFunc: queryRealm ajaxURL: "data.php", //ajax ajaxProgressiveLoad: "scroll",

    – 袁伟麟
    Nov 26 '18 at 2:09












  • yes you will need to have an ajax url even if it isnt used in your loader function, because that is what triggers tabulator to make the call. i have updated my answer

    – Oli Folkerd
    Nov 26 '18 at 8:03










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313961%2fcan-ajaxprogressiveload-work-with-overriding-the-request-promise-in-tabulator%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














That should work as long as your are formatting your returned data in the paginated form that Tabulator is expecting:




"last_page":15, //the total number of available pages (this value must be greater than 0)
"data":[ // an array of row data objects
"id":1, "name":"bob", "age":"23" //example row data object
]



and you are correctly passing the page parameter back to your server.



Though looking at the ajaxRequestFunc it is not doing anything that the built in ajax system dosnt already do (especially since its improvements in v4.1) so im not sure why it is needed in the first place.



You will need to make sure the ajaxURL option has a value in order for your custom loader to be called






share|improve this answer

























  • Hi Oli, I found if I enable ajaxUrl with not an empty string, it works. but I don't know is that a good practice in Tabulator. I have updated my question for an image.

    – 袁伟麟
    Nov 26 '18 at 1:49











  • Side note I found the following config is also 4 times request to data.php as the picture. ajaxRequestFunc: queryRealm ajaxURL: "data.php", //ajax ajaxProgressiveLoad: "scroll",

    – 袁伟麟
    Nov 26 '18 at 2:09












  • yes you will need to have an ajax url even if it isnt used in your loader function, because that is what triggers tabulator to make the call. i have updated my answer

    – Oli Folkerd
    Nov 26 '18 at 8:03















0














That should work as long as your are formatting your returned data in the paginated form that Tabulator is expecting:




"last_page":15, //the total number of available pages (this value must be greater than 0)
"data":[ // an array of row data objects
"id":1, "name":"bob", "age":"23" //example row data object
]



and you are correctly passing the page parameter back to your server.



Though looking at the ajaxRequestFunc it is not doing anything that the built in ajax system dosnt already do (especially since its improvements in v4.1) so im not sure why it is needed in the first place.



You will need to make sure the ajaxURL option has a value in order for your custom loader to be called






share|improve this answer

























  • Hi Oli, I found if I enable ajaxUrl with not an empty string, it works. but I don't know is that a good practice in Tabulator. I have updated my question for an image.

    – 袁伟麟
    Nov 26 '18 at 1:49











  • Side note I found the following config is also 4 times request to data.php as the picture. ajaxRequestFunc: queryRealm ajaxURL: "data.php", //ajax ajaxProgressiveLoad: "scroll",

    – 袁伟麟
    Nov 26 '18 at 2:09












  • yes you will need to have an ajax url even if it isnt used in your loader function, because that is what triggers tabulator to make the call. i have updated my answer

    – Oli Folkerd
    Nov 26 '18 at 8:03













0












0








0







That should work as long as your are formatting your returned data in the paginated form that Tabulator is expecting:




"last_page":15, //the total number of available pages (this value must be greater than 0)
"data":[ // an array of row data objects
"id":1, "name":"bob", "age":"23" //example row data object
]



and you are correctly passing the page parameter back to your server.



Though looking at the ajaxRequestFunc it is not doing anything that the built in ajax system dosnt already do (especially since its improvements in v4.1) so im not sure why it is needed in the first place.



You will need to make sure the ajaxURL option has a value in order for your custom loader to be called






share|improve this answer















That should work as long as your are formatting your returned data in the paginated form that Tabulator is expecting:




"last_page":15, //the total number of available pages (this value must be greater than 0)
"data":[ // an array of row data objects
"id":1, "name":"bob", "age":"23" //example row data object
]



and you are correctly passing the page parameter back to your server.



Though looking at the ajaxRequestFunc it is not doing anything that the built in ajax system dosnt already do (especially since its improvements in v4.1) so im not sure why it is needed in the first place.



You will need to make sure the ajaxURL option has a value in order for your custom loader to be called







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 26 '18 at 8:03

























answered Nov 22 '18 at 21:38









Oli FolkerdOli Folkerd

1,73911117




1,73911117












  • Hi Oli, I found if I enable ajaxUrl with not an empty string, it works. but I don't know is that a good practice in Tabulator. I have updated my question for an image.

    – 袁伟麟
    Nov 26 '18 at 1:49











  • Side note I found the following config is also 4 times request to data.php as the picture. ajaxRequestFunc: queryRealm ajaxURL: "data.php", //ajax ajaxProgressiveLoad: "scroll",

    – 袁伟麟
    Nov 26 '18 at 2:09












  • yes you will need to have an ajax url even if it isnt used in your loader function, because that is what triggers tabulator to make the call. i have updated my answer

    – Oli Folkerd
    Nov 26 '18 at 8:03

















  • Hi Oli, I found if I enable ajaxUrl with not an empty string, it works. but I don't know is that a good practice in Tabulator. I have updated my question for an image.

    – 袁伟麟
    Nov 26 '18 at 1:49











  • Side note I found the following config is also 4 times request to data.php as the picture. ajaxRequestFunc: queryRealm ajaxURL: "data.php", //ajax ajaxProgressiveLoad: "scroll",

    – 袁伟麟
    Nov 26 '18 at 2:09












  • yes you will need to have an ajax url even if it isnt used in your loader function, because that is what triggers tabulator to make the call. i have updated my answer

    – Oli Folkerd
    Nov 26 '18 at 8:03
















Hi Oli, I found if I enable ajaxUrl with not an empty string, it works. but I don't know is that a good practice in Tabulator. I have updated my question for an image.

– 袁伟麟
Nov 26 '18 at 1:49





Hi Oli, I found if I enable ajaxUrl with not an empty string, it works. but I don't know is that a good practice in Tabulator. I have updated my question for an image.

– 袁伟麟
Nov 26 '18 at 1:49













Side note I found the following config is also 4 times request to data.php as the picture. ajaxRequestFunc: queryRealm ajaxURL: "data.php", //ajax ajaxProgressiveLoad: "scroll",

– 袁伟麟
Nov 26 '18 at 2:09






Side note I found the following config is also 4 times request to data.php as the picture. ajaxRequestFunc: queryRealm ajaxURL: "data.php", //ajax ajaxProgressiveLoad: "scroll",

– 袁伟麟
Nov 26 '18 at 2:09














yes you will need to have an ajax url even if it isnt used in your loader function, because that is what triggers tabulator to make the call. i have updated my answer

– Oli Folkerd
Nov 26 '18 at 8:03





yes you will need to have an ajax url even if it isnt used in your loader function, because that is what triggers tabulator to make the call. i have updated my answer

– Oli Folkerd
Nov 26 '18 at 8:03



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53313961%2fcan-ajaxprogressiveload-work-with-overriding-the-request-promise-in-tabulator%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

Museum of Modern and Contemporary Art of Trento and Rovereto