Remove a record from ExtJS Store

28 Oct
Goran

Goran

web developer at test
Goran

Latest posts by Goran (see all)

Wondering maybe on how to delete an ExtJS store record?

Just a beginner hint on how to remove a record from ExtJS store. I am updating some comboboxes and just came in situation where i need to remove some records for particular users.

I noticed on forums that people often search queries like “how to delete ExtJS grid record” or “how to remove a record from ExtJS combobox”.

If you are working with Ext.data.Store or Ext.data.ArrayStore for example, methods are same.

If you want to read more about stores go here.

Ok so to delete store first record:

Delete last record

Delete record on index n

removeAt will update component automatically.

remove method recives model instance or array of instances. removeAt recives record index.

 

  • Or use store.first() to get the first record and store.last() to get the last record and use store.remove(record) with it. Normally do not use store.removeAt as you normally have a record to remove.

    • Ok, nice tips. I updated post.