3
votes

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.

1
So what is the question here? How to only return new rows from the server? Or how to insert those new rows into the grid? - Evan Trimboli
how to insert new rows into the grid (and if the scenario sounds reasonable). Thanks - VAAA
See: docs.sencha.com/extjs/4.2.2/#!/api/Ext.data.Store-method-load Specifically the part about addRecords. - Evan Trimboli
Ok I will read about it. Also I will have to read how to implement that using Ext.TaskRunner. - VAAA

1 Answers

3
votes

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
});