简体   繁体   中英

Tabulator save table to server

Tabulator get an option to parse table from remote server like ajaxURL:"https://mysite/data.json" and download table data as json.

But don't let to upload json data to same or another server.

How can I do the upload function to my table?

This is a very open ended question as that depends on which type of server you are using.

The standard method would be to make an AJAX request to the server, usually a POST or PUT request depending on whether you were creating or updating data.

You would retrieve the data from tabulator using the getData method, which return s an array of row data objects.

var data = table.getData()

You can then use an ajax library of your choice. Browsers come with the built in Fetch API or you could use a 3rd party library like Axios

How you send the data to the server is up to you as you will have to put the code in on the server to process it, so you will set the property names etc that the data will need to be set against in the request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM