PDA

View Full Version : Model - field with a list of integers



fordprefect
14 Jun 2012, 8:34 AM
Hi,

I have a model that looks like this:



Ext.define('Canvas.model.CanvasObjectModel', {
extend: 'Ext.data.Model',

idProperty: 'CanvasId',

fields: [{
name: 'CanvasId',
type: 'int'
},
{
name: 'CanvasObjectId',
type: 'int'
}
});


Basically I need to hold more than one 'CanvasObjectId', but don't see a type to hold a list. Is there a way where I can have many ObjectId's in this model?

Thanks

mattea
14 Jun 2012, 8:47 AM
I am not sure if it is the recommended way, but I imagine you want to use a nested structure (relational data). Apparently it doesn't work well natively with grids (as might be expected). See the example in the Reader class.

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.reader.Reader

fordprefect
15 Jun 2012, 7:25 AM
Thanks