'Does Intellisense work with objects extended with Ext.extend?

I can't get get Intellisense to display any methods other than Object methods when I inherit through Ext.extend(). Is it possible for Intellisense to display the additional methods?

I used the workaround suggested in this SO question to get the namespaces working, so I don't believe that is related to this issue.

Example Code is below:

///<reference path="ext-base.js" />
///<reference path="ext-all.js" />
///<reference path="namespace.js" />
MNS.Production.DetailedGrid = Ext.extend(MNS.commonUI.GridPanel,
{
    initComponent: function () {
    var columns = this.getColumns();
    },

    getColumns: function () {
    var columns =
    //...build columns
    },
    //....
    //....Additional methods, etc.
});


var detailedGrid = new MNS.Production.DetailedGrid();

Although I get intellisense for the MNS.Production.DetailedGrid() command, I don't get any intellisense on the methods of the detailedGrid object, except default methods. How do I get Visual Studio to show these methods?



Solution 1:[1]

I have found that although there are two ways to extend an object using ExtJS, the only way that Intellisense will work with your code is if you use the following syntax:

///<reference path="ext-base.js" />
///<reference path="ext-all.js" />     
// create constructor for new class
Ext.ResizableConstrained = function(el, config){
    Ext.ResizableConstrained.superclass.constructor.call(this, el, config);
};

// extend the base class
Ext.extend(Ext.ResizableConstrained, Ext.Resizable, {
    setXConstraint : function(left, right){
        // Obtain a reference to parent dd property and setXConstraint
        this.dd.setXConstraint(left, right);
    },

   setYConstraint : function(up, down){
     // Obtain a reference to parent dd property and setYConstraint
     this.dd.setYConstraint(up, down);
   }
});

The /// references need to be at the top of the file.

Solution 2:[2]

Have you seen this MSDN post? MSDN Blog

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 amccormack
Solution 2 Glorfindel