lvil
lvil

Reputation: 4326

Adding a record to the store in specific place

Is there a way to add a record to the store after the specific record not using addSorted?

Upvotes: 9

Views: 12956

Answers (2)

Amit Contractor
Amit Contractor

Reputation: 159

More specific way to add new element(s) in store at first place like...

Ext.data.Store.insert(0, [{id: 0, name: '(un-assigned)'}]);

Upvotes: 5

ChrisR
ChrisR

Reputation: 14447

Check Ext.data.Store.insert(index) which allows you to insert a record at a specified index. Only thing you need is the index of the record you want to insert it after, thats what you have Ext.data.Store.find() for

http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.Store

Upvotes: 19

Related Questions