Results 1 to 2 of 2

Thread: Call function in callback section

  1. #1
    Sencha Premium User
    Join Date
    Apr 2016
    Posts
    14
    Answers
    1

    Question Answered: Call function in callback section

    I have a controller code:
    Code:
    loadUser: function (form) {
            var user = Ext.create("MyApp.model.Account");
    
    
            user.load({
    
    
                success: function (record, operation) {
                    console.log('Success');
                },
    
    
                failure: function (record, operation) {
                    console.log('Error');
                },
    
    
                callback: function (record, operation, success) {
                    this.someFunction();
                }
            });
        },
    
    
        someFunction: function () {
            console.log('Some Function.');
        },
    
    onRender: function (object, options) {
            this.loadUser(object);
        },
    After that, I bind a onRender function to render event in the view of this controller:

    Code:
    listeners: {
            render: 'onRender'
        }
    As a result, during startup I see the following error:
    Code:
    Object doesn't support property or method 'someFunction'
    Why can't I call this function? Thank in advance.

  2. You did not specify scope for your load callbacks.

  3. #2
    Sencha User
    Join Date
    Apr 2013
    Posts
    900
    Answers
    105

    Default

    You did not specify scope for your load callbacks.

Similar Threads

  1. Replies: 6
    Last Post: 20 Mar 2015, 9:37 AM
  2. Replies: 2
    Last Post: 30 Aug 2011, 12:55 PM
  3. Why I can't call callback function using Ext with DWR?
    By uclali1986 in forum Ext 2.x: Help & Discussion
    Replies: 9
    Last Post: 9 Apr 2008, 4:57 AM
  4. How to call a callback function from outside?
    By sangharsha in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 7 Apr 2008, 8:48 AM
  5. specifying callback function in subscribed refresh call
    By seldon in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 13 Dec 2006, 12:37 PM

Tags for this Thread

Posting Permissions

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