Clear all records from a store

Illep picture Illep · Jul 29, 2012 · Viewed 23.3k times · Source

I have a store, I am loading records from it successfully. Now i need to clear all the records in it. How can i do this ?

myStore.remove(); // DID NOT WORK
myStore.clear(); // ENDED UP WITH AN ERROR TypeError: myStore.clear is not a function

How could i solve this?

Answer

David Kanarek picture David Kanarek · Jul 30, 2012

Remove will remove the records you pass in. You want removeAll as in myStore.removeAll();