fastcodejava
fastcodejava

Reputation: 41087

ExtJs getCmp failure

I have this code to check the if the form is already there. But it gives an error.

onRender : function() {
    var cmp = Ext.getCmp('myForm');
    if (cmp) {
        alert("Component of this type already exist");
        return;
    }

Error comes from ExtJs core. In debugger, it bombs at the call Ext.getCmp();

Upvotes: 1

Views: 990

Answers (2)

hazimdikenli
hazimdikenli

Reputation: 6019

is your app working fine other that this?

Check all your includes, you should include an adapter before ext-all.js

Upvotes: 0

Mchl
Mchl

Reputation: 62387

re you sure you're using ExtJS (source file ext-all.js) and not Ext Core (source file ext-core.js)?

Ext.getCmp() is part of ExtJS library, and is not present in Ext Core.

Upvotes: 1

Related Questions