[Vuejs]-How to use axios with Tabulator-vue using pagination-remote

1👍

Tabulator allows you to override the built in ajax loader by passing a function to the ajaxRequestFunc setup option.

The function should return a promise that resolves with the table data.

More info can be found in the Overriding the Request Promise section of the ajax documentation.

function queryRealm(url, config, params){
    //url - the url of the request
    //config - the ajaxConfig object
    //params - the ajaxParams object

    //return promise
    return new Promise(function(resolve, reject){
        //do some async data retrieval then pass the array of row data back into Tabulator
        resolve(data);

        //if there is an error call this function and pass the error message or object into it
        reject();
    });
}

var table = new Tabulator("#example-table", {
    ajaxRequestFunc:queryRealm,
});

Leave a comment