VAAA
VAAA

Reputation: 15049

ExtJS interval timer get data and insert new rows in grid

I have my ExtJS 4.2 Application with a grid that initially will load and display data from a database table.

On server side, this table have new data about every 10 seconds, so I want to have a Ext.TaskRunner that every 10 senconds will go again to my WebService, get new data and insert it to the grid.

So, I dont want to get all data from server, just the new one. That's why I need to know how to do this with ExtJS. TaskRunner and grid (inserting new rows).

Hope someone can help me.

Upvotes: 3

Views: 2648

Answers (1)

Shalev Shalit
Shalev Shalit

Reputation: 1963

this is how the function should be

Ext.TaskManager.start({
  run: function(){
    // Ajax request with store.add()
    // OR store.load({addRecords: true}) as @Evan Trimboli said
    // also you can add start parameter store.load({start: store.count()})
  },
  interval: 10000
});

Upvotes: 3

Related Questions