2
setInterval(() => {
  // lets update the config
  grid.updateConfig({
    server: {
      url: document.location.href + 'api.json/',
      then: data => data.map(obj => {
        return [obj.name, obj.value]
      }),
      handle: (res) => {
        // no matching records found
        if (res.status === 404) return { data: [] }
        if (res.ok) return res.json()
        throw Error('oh no :(')
      }
    }
  }).forceRender()
}, 2000)

This snippet make the work, but loading message and flicking/redraw all table are ruining UX.

Pang
  • 9,564
  • 146
  • 81
  • 122

0 Answers0