Refresh the data in the table
I am populating the table using a url. Is there any method I can call that will requery the url and refresh the data? I know about the setData method, but I don't think it helps here. I also tried to destroy the table and rebuild it, but I get error "Uncaught TypeError: Cannot read property 'apply' of undefined". Thanks in advance for your answer.
I have included a new method call: table.refresh(); this will make the trick.
Available on v3.7.2
Works like charm. You are awesome. Thank you so much.
I'm trying to use this table.refresh and isnt wokring? tried to update to version 3.7.2 but got an error. No matching version found for jexcel@^3.7.2.
Also unsure on how to call this. @lyassa, have any insight?
The example is not the best. but if you loading data from a URL makes more sense.
<div id="spreadsheet"></div>
<script>
var data = [
['Mazda', 2001, 2000, '2006-01-01'],
['Pegeout', 2010, 5000, '2005-01-01'],
['Honda Fit', 2009, 3000, '2004-01-01'],
['Honda CRV', 2010, 6000, '2003-01-01'],
];
var table = jexcel(document.getElementById('spreadsheet'), {
data:data,
columns: [
{ type: 'text', width:300 },
{ type: 'text', width:80 },
{ type: 'text', width:100 },
{ type: 'calendar', width:100 },
]
});
// After
table.refresh()
</script>
@paulhodel Hi Paul, I can't use "table.refresh()" on v7 pro. It shows "table.fresh is not a function". Is there any other way to update all the datas? Thanks!