ce icon indicating copy to clipboard operation
ce copied to clipboard

Refresh the data in the table

Open lyassa opened this issue 6 years ago • 7 comments

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.

lyassa avatar Dec 12 '19 01:12 lyassa

I have included a new method call: table.refresh(); this will make the trick.

pphod avatar Dec 12 '19 19:12 pphod

Available on v3.7.2

pphod avatar Dec 12 '19 19:12 pphod

Works like charm. You are awesome. Thank you so much.

lyassa avatar Dec 12 '19 23:12 lyassa

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.

ghost avatar Jan 09 '20 13:01 ghost

Also unsure on how to call this. @lyassa, have any insight?

wescrockett avatar Feb 18 '20 21:02 wescrockett

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>

pphod avatar Feb 19 '20 20:02 pphod

@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!

Louise-Huang avatar Jun 18 '21 06:06 Louise-Huang