1. #1
    Sencha User
    Join Date
    Dec 2009
    Location
    Enschede, The Netherlands
    Posts
    327
    Vote Rating
    13
    flanders will become famous soon enough

      0  

    Default [solved] JsonStore.recordType returns undefined

    [solved] JsonStore.recordType returns undefined


    Hello everyone,

    For a while now I've been using Ext3.0, but today I've struggled with an call to JsonStore.recordType() returning undefined.

    The code where the error occurs. Here record becomes undefined and the store.add throws an 'record[i]' is undifined in firebug
    Code:
                            Ext.Msg.prompt('Naam', 'Geef een nieuwe naam voor de denominatie op:', function(btn, text) {
                                if (text != '') {
                                    record = this.items.get(0).store.recordType({
                                        name: text
                                    });
                                    this.items.get(0).store.add(record);
                                }
                            }, this);
    The store:
    Code:
    store.DenominationStore = Ext.extend(store.BaseStore, {
        constructor: function(config) {
            store.DenominationStore.superclass.constructor.call(this, Ext.apply({
                fields: [{
                    name: 'id'
                },{
                    name: 'name'
                }],
                url: 'php/ajax/denominations.php'
            }, config));
        }
    });
    
    store.BaseStore = Ext.extend(Ext.data.JsonStore, {
        constructor: function(config) {
            store.BaseStore.superclass.constructor.call(this, Ext.apply({
                autoLoad: true,
                autoSave: true,
                autoDestroy: true,
                batch: false,
                idProperty: 'id',
                totalProperty: 'totalCount',
                remoteSort: true,
                listeners: {
                    'exception' : function(proxy, type, action, options, response, arg) {
                        if (type == 'response') {
                            json = Ext.decode(response.responseText);
                            error.actionCanceled(json.reason);
                        } else if (type == 'remote') {
                            error.actionCanceled(response.reason);
                        } else {
                            error.unknownError();
                        }
                    }
                },
                root: 'data',
                writer: new Ext.data.JsonWriter({
                    encode: true,
                    writeAllFields: true
                })
            }, config));
        }
    });
    If anyone has any pointers, I'd appreciate that!

    I'm new btw, so please forgive me if i missed something obvious i should hav added.

    greetz,

    Flanders
    Last edited by flanders; 24 Dec 2009 at 4:14 PM. Reason: solved

  2. #2
    Sencha User MaximGB's Avatar
    Join Date
    Jun 2007
    Location
    Moscow, Russia
    Posts
    493
    Vote Rating
    3
    MaximGB is on a distinguished road

      0  

    Default


    You have forgotten new.
    Code:
    new this.items.get(0).store.recordType({...});
    Use the force - read the source.
    My ExtJS extensions can be found here: http://max-bazhenov.com/dev/

  3. #3
    Sencha User
    Join Date
    Dec 2009
    Location
    Enschede, The Netherlands
    Posts
    327
    Vote Rating
    13
    flanders will become famous soon enough

      0  

    Default


    Thanks for the fast reply, recordType() is indeed a constructor.

    BTW: To be complete it appears I also couldn't use

    Code:
    record = this.items.get(0).store.recordType({


    but had to make an extra variable and use

    Code:
    record = instanceStore.recordType({


  4. #4
    Sencha User
    Join Date
    Apr 2010
    Posts
    100
    Vote Rating
    0
    Dipish is an unknown quantity at this point

      0  

    Default


    I confirm that this issue exists and is quite irritating. Please provide recordType property initialization when creating JsonStore!

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar