Page 1 of 1

Datatable not updating after long running "Run Typescript"

Posted: Fri Oct 09, 2020 5:17 am
by kevinmcisaac

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?


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

Posted: Fri Oct 09, 2020 7:22 am
by kevinmcisaac

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


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

Posted: Fri Oct 09, 2020 12:37 pm
by Galyna Abramovych

Dear Kevin,

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


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

Posted: Fri Oct 09, 2020 11:42 pm
by kevinmcisaac

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


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

Posted: Sat Oct 10, 2020 6:12 am
by Galyna Abramovych

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