PDA

View Full Version : [INFOREQ] Reader.buildExtractor ignores zero properties



doublep
23 Jun 2011, 4:02 AM
Numeric zero properties are useful with array reader. In my case I want to set record id from the first element of array. However, this currently doesn't work as buildExtractor checks properties as "if (idProp)" etc. rather than e.g. "if (Ext.isDefined (idProp))" or some other test that would pass for 0.

To reproduce:

Ext.create ('store.store',
{ fields: ['id', 'lol'],
proxy: { type: 'memory', reader: { type: 'array', idProperty: 0 } },
data: [['1', '2']] }).data.items[0].internalId

gives "ext-record-#". However, if I swap fields:

Ext.create ('store.store',
{ fields: ['lol', 'id'],
proxy: { type: 'memory', reader: { type: 'array', idProperty: 1 } },
data: [['2', '1']] }).data.items[0].internalId

it gives "1", as expected.

germanicus
23 Jun 2011, 1:25 PM
Thanks for the report, we've just introduced a new bug template that will help us migrate bugs from the forums to our bug tracker. Could you please update your ticket to follow this template (http://www.sencha.com/forum/showthread.php?138165-How-to-report-a-bug) so that we can address it faster?