Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a record to the store in specific place

Tags:

extjs

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

like image 405
lvil Avatar asked Mar 02 '11 14:03

lvil


2 Answers

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

Ext.data.Store.insert(0, [{id: 0, name: '(un-assigned)'}]);
like image 80
Amit Contractor Avatar answered Nov 16 '22 11:11

Amit Contractor


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

like image 27
ChrisR Avatar answered Nov 16 '22 11:11

ChrisR