I have a datatable synced to a Jet model and the table loads data fine. When a row is added, I’m attempting to refresh the table.
Here’s my code:
$$("my_dt").clearAll();
recentTimeList = timetickets.recentData(employeeid); //a filtered method on my model
recentTimeList.waitData.then(function () {
$$("my_dt").data.sync(recentTimeList);
$$("my_dt").refresh();
});
The table seems to be refreshing before the waitData completes. Most of the time a new row does not appear in the table. If I add another row, the prior row appears. I tried adding a 500ms delay and that gets the screen to work about 50% of the time.
The source of the datatable is a REST service. What am I missing here?