View Full Version : Trouble with multiple instances of a panel with itemId

6 Oct 2012, 5:56 PM
Having trouble with multiple instances of a panel each with itemId 'savebtn' on a button. I have made the panel instance itemId unique, and the savebtn exists on each panel. I want to access the unique panel's savebtn only, and I am stymied. Have been at this for hours now. This statement:

Ext.ComponentQuery.query('#' + me.itemId).down('#savebtn').enable();

yields an error:

Uncaught TypeError: Object [object Object] has no method 'down'

So what I am getting back with Ext.ComponentQuery.query('#' + me.itemId) is an object, which I thought we were able to traverse up or down. What is the point of doing a component query if we can't go up or down? How do I do this properly?

6 Oct 2012, 5:58 PM
Ext.ComponentQuery.query() returns an array of matched components. So try to fix your code as below:

Ext.ComponentQuery.query('#' + me.itemId)[0].down('#savebtn').enable();