0

I can't change the web server so I can't enable compression on the .json file automatically. This would be my ideal solution.

I would like tabulator to pull down a json file that is compressed to a gz file, but I don't know if it's possible or what I would need to do in order to tell it to decompress it before trying to use it.

Is there a way to set the ajaxURL to gz and it work?

Thanks

Oli Folkerd
  • 7,510
  • 1
  • 22
  • 46
Jim Sellers
  • 523
  • 3
  • 15

1 Answers1

0

You could use the ajaxResponse callback to take the incoming compressed data and then decompress it before passing it into Tabulator.

In this example im going to use the advice of this GZip Stack Overflow Question so you will need to copy the uncompress function from there

var table = new Tabulator("#exmaple-table", {
    ...other table config
    ajaxResponse:function(url, params, response){
        return uncompress(response);
    },
});

Full details of the ajaxResponse callback can be found in the Ajax Documentation

Oli Folkerd
  • 7,510
  • 1
  • 22
  • 46