Jet Datatable from REST refresh

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?

Hi,

As far as I can see, data syncing with DataCollection and Datatable works normally: http://webix.com/snippet/9561985d

In your code you need to apply syncing once and you needn’t do it in the waitData handler. You should just sync an empty datatable and empty collection, and when the data is loaded or added to a collection, it will be shown in the datatable.