Announcement

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

    Class inheritance -- chaining JS statements

    The following doesn't work and I'm not sure why:

    Code:
    isc.ClassFactory.defineClass("MyTreeGrid","TreeGrid")
      .addProperties({
        menuID: null
      })
      .setInstanceProperty("showHeader",false);
    Whereas this does work:

    Code:
    isc.ClassFactory.defineClass("MyTreeGrid","TreeGrid")
      .addProperties({
        menuID: null
      });
    
    isc.MyTreeGrid.setInstanceProperty("showHeader",false);
    I thought addProperties() returned the defined class with properties added? So why can't I chain statements like this? It's not that big a deal, but it's an aesthetic thing -- I find it cleaner.

    #2
    Good catch, the return value is actually incorrect - what is returned is actually something called the instancePrototype. This has been corrected.

    Comment

    Working...
    X