Greetings,
I have to manually remove records by ID. I failed to find such a method in the default implementation. Thus, to accomplish this I had to subclass Ext.data.Store and introduce a new method called removeId. Here is the code:
I wonder if I'm missing something and there is a simpler way of manually removing records by ID.
I have to manually remove records by ID. I failed to find such a method in the default implementation. Thus, to accomplish this I had to subclass Ext.data.Store and introduce a new method called removeId. Here is the code:
myNS.Store = function (config) { myNS.Store.superclass.constructor.call(this, config); } Ext.extend(myNS.Store, Ext.data.Store, { removeId: function (id) { var index = this.indexOfId(id); this.data.removeAt(index); this.fireEvent('remove', this, null, index); } });

#2
![]() |
![]() Simpler than 3 lines of code? What do you want from it.. mind reading software :?:
![]() |
#3
![]() |
![]() No, this way is ok for. I just meant probably there is similar method in the default implementation and I don't have to subclass it.
![]() |
#4
![]() |
![]() Did you try:
store.remove(store.getById(id)); ![]() |
#5
![]() |
![]() Indeed, this seems to be what I need. I'll give it a try.
![]() |