kevinmcisaac
Posts: 37
Joined: Mon Oct 05, 2020 8:27 am

Datatable not updating after long running "Run Typescript"

I have a button with a CLICK event with a "Run Typescript". This script takes a few seconds to complete while it reads and processes data.

The data is pushed into a varialble (logData). I then have a datatable with rows set to this variable and [hidden] logData.length==null.

After the button is clicked the datatable is unhidden and it shows in table footer that the right number of rows has been read, but the data table is emptly.

I'm guessing the table is not updating after the typescript is run. I tried adding a CLICK update datatable to the button, but this did not help. Probably as this does not wait on the typescript.

What should I do to fix this?

kevinmcisaac
Posts: 37
Joined: Mon Oct 05, 2020 8:27 am

Re: Datatable not updating after long running "Run Typescript"

I found a fix.
My code was written to remove multiple updates of the variable used in the datatable to just a single update.

The original code where the datatable did not work was.

this.logTable = []; // The variable used in the data table
for (const file of fileList) {
const contents = await readFile(file);
let logEntry = this.mapToLogEntry(contents);
this.logTable.push(logEntry);
};

now it to this....

let log = [];
for (const file of fileList) {
const contents = await readFile(file);
let logEntry = this.mapToLogEntry(contents);
log.push(logEntry);
};
this.logData = log; // The variable used in the data table

Galyna Abramovych
Site Admin
Posts: 84
Joined: Tue Mar 22, 2016 6:03 pm

Re: Datatable not updating after long running "Run Typescript"

Dear Kevin,

Glad you got it to work!
And thank you for sharing your results!

kevinmcisaac
Posts: 37
Joined: Mon Oct 05, 2020 8:27 am

Re: Datatable not updating after long running "Run Typescript"

Galyna, this looks like a bug that should be followed up. How do I submit bug reports?

Galyna Abramovych
Site Admin
Posts: 84
Joined: Tue Mar 22, 2016 6:03 pm

Re: Datatable not updating after long running "Run Typescript"

You can do so by writing to support@appery.io.
Thank you for consideration!

Return to “Issues”