I am using Ext.get to get an element. I am using Eclipse and Spket. In spket editor I see the get method is red in color. Also there is no autocomplete support for the variable I declared.
var exp = Ext.get('id'),
is this a correct behavior? Why there is no autocomplete for exp variable ? am I using correct Ext method ? What would be the best practice?
I think this might be more of a Spket question. any pointer would be helpful.
if you want to get an Ext component based on its id, then you should be using Ext.getCmp('componentId'). however, using an id is discouraged. you can use componentquery to find the Ext component you want. after you get the component, you can use its methods.
Thanks Farish, could you please site an example for using the componentquery. I am going thru a book which sites examples all using get. Kinda strange.
Scenario: if in a page I have
and button 1,2,3
how to get access of the Ext elements.
I am not sure what you want to do with the Ext elements/components. it could be that Ext.get() does what you need. Take a look at the API docs and then decide whether Ext.get() is what you want or Ext.getCmp(). you can also find info on component queries there along with examples.