olifolkerd / tabulator

Interactive Tables and Data Grids for JavaScript
http://tabulator.info
MIT License
6.76k stars 821 forks source link

Improve documentation for "setup options" section #4624

Open KES777 opened 2 weeks ago

KES777 commented 2 weeks ago

Website Page https://tabulator.info/docs/6.3/options

Describe the issue From the documentation it is not clear how to change options for already existing table. eg.

var customT = Tabulator.findTable('#id')[0];
customT.options.ajaxURL = "/ajax/db.json";
customT.setData();

Will load data from ajaxURL which was provided during first start.

Q: Curious, why setData do not use updated URL?

Answering my own question: A: This is not documented, but Tabulator copies that value into url property. And then ignores ajaxURL. (Why this is done?)

Also setUrl is not documented.

//initialize setup options
    initialize(){
        this.loaderPromise = this.table.options.ajaxRequestFunc || Ajax.defaultLoaderPromise;
        this.urlGenerator = this.table.options.ajaxURLGenerator || Ajax.defaultURLGenerator;

        if(this.table.options.ajaxURL){
            this.setUrl(this.table.options.ajaxURL);
        }