Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Can autoChild constructor be passed as string or function?

    I'm using autoChildren for the first time and it's very cool! The way my source code is organized (and will be minified), is that various JavaScript files are loaded in alphabetical order. I need to specify an constructor for an auto child before that code is actually loaded. Is there a way to use a string instead of the class itself? Or a function returning the class? Else, I need to include the source code in "load" order.

    Code:
      isc.defineClass('ClassA', isc.VLayout).addProperties({
        headerDefaults: {
          _constructor: isc.ClassB // oops, ClassB not yet defined
        },
        ...
      });
    
      isc.defineClass('ClassB', isc.VLayout).addProperties({
        ...
      });

    #2
    Yes, the autoChild constructors can be specified as String classNames.

    Comment


      #3
      Great! I thought I tried that, but I used the 'isc.' prefix in the string, which doesn't work.

      Comment

      Working...
      X