Results 1 to 2 of 2

Thread: Question about this.callParent.caller returning null

  1. #1
    Sencha User
    Join Date
    Dec 2015
    Posts
    1

    Default Question about this.callParent.caller returning null

    Hi,

    I have an app (ext.js 4.2) that is composed of several js-files (a, b, c, ...), concatenated in a specific order; concat(a, b, c, ...). And this works nicely.

    Now, to enable more rapid development I'd like to serve a, b, c, ... separately like such in the header:

    <script src="a"/>
    <script src="b"/>
    <script src="c"/>
    ...

    Note: ext.js is always included prior to my own files.

    However, using separate serving I get a problem when calling this.callParent from inside a custom subclass. Because this call goes to this code block:

    Code:
    callParent: function(args) {
        var method;
       
        return (method = this.callParent.caller) && (method.$previous ||
              ((method = method.$owner ? method : method.caller) &&
                    method.$owner.superclass.self[method.$name])).apply(this, args || noArgs);
    },
    and when my files are not concatenated this.callParent.caller is always null. But when my files are concatenated, this.callParent.caller will correctly reference the function from which it was called. Typically at the end of a components initComponent method.

    Can anyone help me with this?

    Let me know if I need to clarify things.

    Thanks in advance!

  2. #2
    Sencha User jdkhamba's Avatar
    Join Date
    Jul 2012
    Posts
    236
    Answers
    45

    Default

    There is no need to load the various files using script tag if you are creating a single page application with the recommended folder structure mentioned here:

    http://docs.sencha.com/extjs/4.2.0/#...n_architecture

    All you need to do is mention in your application class the files that are required like this :

    Code:
    requires:['Fiddle.view.*']
    Take a look at this example:

    https://fiddle.sencha.com/#fiddle/12l6

    Both the required files are loaded dynamically by ExtJS. no <script> tag needed.

Similar Threads

  1. Silly question regarding callParent
    By jhoweaa in forum Ext: Q&A
    Replies: 2
    Last Post: 22 Jan 2013, 5:49 AM
  2. override callParent question
    By ttbgwt in forum Ext: Q&A
    Replies: 1
    Last Post: 21 Aug 2012, 6:54 PM
  3. Ext.getStore returning null
    By jiewmeng in forum Ext: Q&A
    Replies: 1
    Last Post: 23 May 2012, 6:57 AM

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
  •