views:

24

answers:

2

can you associate a component or element in ext-js with a arbitrary object? eg. store(component, 'key', obj), get(component,'key');

A: 

I am not quite sure about the solution to this question, but you should check #extjs @ irc.freenode.net if nothing comes up here. They are very helpful people.

Hope this helps somehow.

leomdg
A: 

I just ran across this old unanswered question while retagging, so for posterity...

All referenced elements and created components are automatically cached in global hashes by the Ext framework. For elements, you would retrieve them like so:

var myEl = Ext.get('myId');

Components are managed by the ComponentManager singleton and retrieved like so:

var myComp = Ext.getCmp('myId');

If you simply want to store an arbitrary reference to an element, component or anything else for that matter, you can do so in any way that you would normally do it generically in JS (store off the var reference directly in application-level scope, store it in an array or hash object, etc.)

bmoeskau