PDA

View Full Version : Documentation bug in Ext.data.Store::add



Dumas
24 Nov 2012, 4:57 AM
REQUIRED INFORMATION




Sencha Touch version tested:

Sencha Touch 2.x documentaiton


Description:

The documentation claims that it takes an array of model instances, but in the example it also takes an model configurations.
Also there is often used a singular (model), which is confusing. I had to check the source to be sure how to use it.
http://docs.sencha.com/touch/2-0/#!/api/Ext.data.Store-method-add


The result that was expected:

Please make possible usages clearer.
myStore.add({some: 'data2'}, {some: 'other data2'});
myStore.add([{some: 'data2'}, {some: 'other data2'}]);
myStore.add(new MyApp.data.MyModel({some: 'data2'}));
...

Best regards,
Roland

mitchellsimoens
24 Nov 2012, 6:16 AM
In 2.1 the accepted has been changed to


Ext.data.Model[]/Ext.data.Model... model

So it says it can accept an array and a single model. In the example it also shows that it can accept single config objects.

Dumas
24 Nov 2012, 7:38 AM
Ok, the first sentence is not really english "Adds Model instance to the Store. ", but the rest seems ok.

Bug can be closed.