PDA

View Full Version : Timeout updating element of store



gaiverrr
20 Sep 2012, 1:53 AM
Hi guys!
I have a rest store and grid. In the store i have list of elements, each of it has property isAvailable.
So, what is the best solution, according best practice in extjs, for periodically updating each element which is not yet available? I know, that I can execute store.update() by timeout, but maybe there is another solution?

scottmartin
20 Sep 2012, 7:15 AM
Are you asking how to update a store on an interval basis?

Scott.

gaiverrr
20 Sep 2012, 10:54 AM
Are you asking how to update a store on an interval basis?

Scott.

I'm asking about possibility update not all store by request, but only several records.
For example, I have a store:
[{id:1, isAvailable:false}, {id:2, isAvailable:true}, {id:3, isAvailable:true}]
If course I can make: setInterval(function(){store.sync()}, 1000) but this solution will update all store. I want update only records with isAvailable:false
I'm sorry if I'm not quite clearly explained

scottmartin
20 Sep 2012, 1:20 PM
You can use record.getAt() and record.set(index,record) to update specified records.

Scott.