Kein
Kein

Reputation: 996

ExtJS 4 Grid Update

Sorry if this is a stupid question, but I'm trying to learn ExtJS ;)

Im create model.

Ext.regModel('item',{

Create data store.

var store = Ext.create('Ext.data.Store', {
        model: 'pitem',

Create Grid

var grid = new Ext.grid.GridPanel({
        store: store,

Work good and load data on document load succcessful. But now I need to update grid every 30 minutes or by clicking the refresh button. How can I execute the update action?

Upvotes: 3

Views: 4991

Answers (3)

scebotari66
scebotari66

Reputation: 3480

The part with upgrading store every 30 minutes :

var task = 
{
   run : function() 
   {
      store.load();
   },
   interval: 1800000 //(1 second = 1000)
}

Ext.TaskManager.start(task);

Upvotes: 7

Andrey Selitsky
Andrey Selitsky

Reputation: 2604

you can load data directly using store.loadData() function.

Upvotes: 1

Tommi
Tommi

Reputation: 8608

To reload the data of your Store, just call store.load().

Upvotes: 2

Related Questions