1. #1
    Sencha User
    Join Date
    Feb 2008
    Location
    Bottmingen, Switzerland
    Posts
    6
    Vote Rating
    0
    davidrolli is on a distinguished road

      0  

    Default How to reference an array

    How to reference an array


    How can I import data from an array created somewhere else in the code in a GridView in Sencha Architect 2. I defined a Memo Proxy and a Array Reader which are used by a Store, but i don't see where i can define/reference this array.


    The Proxy/Reader code:
    -----------------------
    Ext.define('MyApp.model.Model_Massnahmen', {
    extend: 'Ext.data.Model',

    proxy: {
    type: 'memory',
    reader: {
    type: 'array'
    }
    },

    fields: [
    {
    name: 'massnahme',
    type: 'string'
    },
    {
    dateFormat: '"d.m.Y"',
    name: 'termin',
    type: 'date'
    },
    {
    name: 'verantwortlichkeit',
    type: 'int'
    }
    ]
    });


    The model code:
    ---------------
    Ext.define('MyApp.store.Store_Massnahmen', {
    extend: 'Ext.data.Store',

    requires: [
    'MyApp.model.Model_Massnahmen'
    ],

    constructor: function(cfg) {
    var me = this;
    cfg = cfg || {};
    me.callParent([Ext.apply({
    autoLoad: false,
    autoSync: false,
    storeId: 'Store_Massnahmen',
    model: 'MyApp.model.Model_Massnahmen',
    fields: [
    {
    name: 'massnahme'
    },
    {
    name: 'termin'
    },
    {
    name: 'verantwortlichkeit'
    }
    ]
    }, cfg)]);
    }
    });

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,080
    Vote Rating
    113
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    yourStore.loadData(yourArray);
    Aaron Conran
    @aconran
    Sencha Architect Development Team

Thread Participants: 1

Tags for this Thread