Tuesday, July 23, 2013

ExtJS: Object doesn't support this action

I recently ran into an issue where my ExtJS application was throwing an error in IE8:

Object doesn't support this action

The issue was coming from an inconspicuous block:
        var me = this;
        item = me.getUserContactView();
        item.hide();

The issue here is that IE8 has issues with certain variable names in global scope -- the one here being item.

To fix this issue, all I had to do was put the variable into local scope:

        var me = this,
        item = me.getUserContactView();
        item.hide();