eisenbraun / columns

A jQuery plugin that converts JSON data into searchable, sortable, HTML tables
http://eisenbraun.github.io/columns
MIT License
104 stars 47 forks source link

grid doesn't update unless i reload the web page #31

Open mcorning opened 5 years ago

mcorning commented 5 years ago

here is the sockets.io event handler that renders json returned from server into the columns plugin.

the top two steps render content and metadata into separate

tags, and the data returned is not the same as the data in the #mongo tag (the mongo tag is stale, and the raw incoming json is up to date).

when i reload the web page, the two data visualizations match.

is there another way to refresh columns with a fresh batch of data? or does the grid only update on document.ready() or onLoad()?

Stack trace snippet:

Columns (jquery.columns.js:382)

...

i.onData (index.js:83)

i.onLoad (index.js:83)

hasXDR.e.onreadystatechange (index.js:83)

other than this issue, you've saved me tons of time in my prototyping...

read well and prosper michael corning

loviuz commented 2 years ago

I have done this with:


setInterval(function() {
    $.get('data.json', function(data) {
        $('#mygrid').columns('setMaster', data);
    });
}, 5000);