ExtJS Duplicate Store Record

I want to take a recording from the store and duplicate it. Is there a way to make it default in ExtJs? I have looked through the docs and cannot find a way.

+3


source to share


1 answer


You can take the entry from the store and copy it. After that add the clone to the repository.

http://docs.sencha.com/extjs/6.0/6.0.0-classic/#!/api/Ext.data.Model-method-copy

var rec = record.copy(null); // clone the record but no id (one is generated)
myStore.add(rec);

      



You can also clone it, which will save your changes.

http://docs.sencha.com/extjs/6.0/6.0.0-classic/#!/api/Ext.data.Model-method-clone

+3


source







All Articles