Results 1 to 6 of 6

Thread: generated code uses "me" which is not defined

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium User
    Join Date
    Feb 2011
    Posts
    7

    Default generated code uses "me" which is not defined

    When adding an event binding for exception, the following code is generated

    proxy: {
    type: 'ajax',
    url: 'myUrl',
    reader: {
    type: 'json',
    rootProperty: 'myRoot',
    listeners: {
    exception: {
    fn: me.onJsonException,
    scope: me
    }
    }
    }
    },

    This causes a run time error that "me is undefined".

    I am using architect 4.0.2.209 and ext 6.2.0.981.

  2. #2
    Sencha Premium User
    Join Date
    Feb 2011
    Posts
    7

    Default

    (Saving the post messed up my code formatting for some reason, but hopefully you get the idea.)

  3. #3
    Sencha User
    Join Date
    Sep 2014
    Location
    Central Europe
    Posts
    795

    Default

    Hello

    Thank you for the report. Could you please post info about your framework version and in which class this occurs?
    I believe that this is in the store in viewmodel in the modern62 right? We are tracking this. In this case please use view controller event binding.

    Thank you

  4. #4

    Default

    Hi All.

    I have the same error creating an event binding in a store. When I selecte from the combo the event type, is generated a listeners with the event, where the scope is "me".
    Code:
    Ext.define('PmsPoc.store.xptoStore', {
        extend: 'Ext.data.Store',
        alias: 'store.me',
        requires: [
            'PmsPoc.model.KaNxModel',
            'Ext.data.proxy.Ajax',
            'Ext.data.reader.Json'
        ],
        config: {
            me: 'this'
        },
        autoDestroy: true,
        storeId: 'xptoStore',
        autoLoad: false,
        model: 'PmsPoc.model.KaNxModel',
        proxy: {
            type: 'ajax',
            url: 'data/gridPanel1_data.json',
            reader: {
                type: 'json',
                rootProperty: 'items'
            }
        },
        listeners: {
            beforeload: {
                fn: me.onJsonstoreBeforeLoad,
                scope: me
            }
        }
    ,
        onJsonstoreBeforeLoad: function(store, operation, eOpts) {
        }
    });

  5. #5
    Sencha User
    Join Date
    Sep 2014
    Location
    Central Europe
    Posts
    795

    Default

    Hi Alexander

    Are you on the latest version of the SA aka 4.1.2 or 4.1.1 ?? Which framework are you using? Could you describe the steps to create such store?

    My basic store looks like this:
    Code:
    Ext.define('MyApp.store.MyStore', {
        extend: 'Ext.data.Store',
    
    
        requires: [
            'Ext.data.field.Field'
        ],
    
    
        constructor: function(cfg) {
            var me = this;
            cfg = cfg || {};
            me.callParent([Ext.apply({
                storeId: 'MyStore',
                fields: [
                    {
                        name: 'one'
                    },
                    {
                        name: 'two'
                    },
                    {
                        name: 'three'
                    }
                ],
                listeners: {
                    add: {
                        fn: me.onStoreAdd,
                        scope: me
                    }
                }
            }, cfg)]);
        },
    
    
        onStoreAdd: function(store, records, index, eOpts) {
    
    
        }
    
    
    });

  6. #6

    Default

    Sencha Architect

    version: 4.0.0.168
    channel: 4.0-stable
    platform: 1.2.3.16 - win32 x64
    cmd: 6.2.0.103
    framework: Ext JS 6.2.x Classic


    So, I create the store using the button "+" in the Project Inspector and after I set some configs, like storeId, model, etc... After that, in the properties/config panel (rigth bottom corner), I create the function in Basic Event Bindings, selection beforeload and the previous javasscript was generated.

  7. #7
    Sencha User
    Join Date
    Dec 2008
    Location
    France
    Posts
    321

    Default

    For me, the bug doesn' appear in the proxy config of the store, but in the proxy config of the model of the store.
    I'm trying to apply the sample provided in the sencha doc http://docs.sencha.com/extjs/6.5.2/m...roxy.Rest.html to perform a crud action.

    Version: 4.2.2.282
    Channel: 4.2-stable
    Platform: 1.6.2.49 - win32 x64
    Renderer: 56.0.2924.87
    Cmd: 6.5.2.15
    Framework: Ext JS 6.5.x Classic

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •