PDA

View Full Version : [CLOSED] Append a Record to the Store



Peter.Treier
May 05, 2013, 3:44 PM
Guess who - me again :-)

Today is really rough...

I got a grid with some data in the store. Now a need to add a new record at the end of the Grid. My 'normal' adding looks like


grid.getStore().add({ Id: newPseudoGUI() });

Is there a way to manage the 'position' where the record is inserted ?

Peter

Peter.Treier
May 05, 2013, 3:56 PM
grid.getStore().add({ Id: newPseudoGUI() });



Well, i found it by my self - always searched for something like addAt() at Sencha...

Now I found

grid.getStore().insert(index,{ Id: newPseudoGUI() });

works.

Please close this thread :-)

jchau
May 05, 2013, 3:57 PM
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.data.Store-method-insert

There's an insert method that takes in position and the new record. It is also used in this example:

http://examples2.ext.net/Examples/GridPanel/Saving_Variations/HttpHandler/

Baidaly
May 05, 2013, 9:30 PM
Hello!

Thank you @jchau for your answer!