I’m using a smart table by creating it with this syntax:
window.Smart(divId, class {
get properties() {
return {
dataSource: new window.Smart.DataAdapter({
dataSource: [], // initially just empty table
id: id,
dataFields: [ ... ]
}),
...
}
}
});
After that I use methods like addRow and others to work with the table. Most of the time, this works, but on occasion I get errors like follows:
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'boundSource')
This happens on first call to addRow about 5% of the time.
Is the Smart call async maybe? Like can I call window.Smart().then(…)? It seems like I need to somehow wait for the table to finish initializing.