-
22 Jan 2010 1:53 AM #1
Ext get element by class name
Ext get element by class name
Hi
I am new to Extjs .
Is their any provisions to get element by class name
Thanks
-
22 Jan 2010 2:09 AM #2
API docs? DomQuery? Ext.Element.select? Ext.Element.query?
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
22 Jan 2010 4:08 AM #3
-
24 Jan 2010 9:21 PM #4
Ext get element by class name
Ext get element by class name
hi
In Extjs how to get Id of element which has class="foo".
Thanks
-
25 Jan 2010 12:10 AM #5
There might be many elements with class "foo".
The documentation which you have of course read tells you how to find them. You did read it didn't you?Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
16 Nov 2010 11:37 AM #6
I'm sure that you found out how to accomplish this, but I'd like to answer so the solution gets written for feature reference and maybe save to someone a couple of hours.
Element.query and Element.select can be used to this.
elems is an array of the elements that has the CSS_SELECTOR.PHP Code:var parent = Ext.get("IdOfParent");
var elems = parent.select("CSS_SELECTOR").elements;
//OR
elems = parent.query("CSS_SELECTOR");
The CSS_SELECTOR is of this form:
<tagName>.<className>
So, if you want the elements with class="foo" you need to know wich tag they are and do this:
I suggest that you use Visual Studio to debug the script and find out the structure of the returned objects. FireBug may help too if you don't have Visual Studio.PHP Code:var parent = Ext.get("IdOfParent");
var elems = parent.select("div.foo").elements;
//OR
elems = parent.query("div.foo");
-
16 Nov 2010 1:41 PM #7
How's Visual Studio debugging Ext/Dom stuff? That's hot, I want one.
Wes
-
23 Feb 2011 11:41 AM #8


Reply With Quote