PDA

View Full Version : Ext.get called by different tags



grunvald
1 Jun 2007, 12:17 AM
Hello !

I'm a beginner with ext and I would like to know if it's possible to capture events comming from different tags with common ids. My ids are like that : myid01, myid02... but I just know in advance the common part "myid" (the rest is built by JSF).
Is it possible to write a method like this : Ext.get('myid*') ?

Thanks in advance !
Grunvald

BernardChhun
1 Jun 2007, 2:50 AM
you could use the Ext.select() function to gather those elements first then do some stuff on them.

I'm not quite fluent with Regexes in the syntax for the select though:

as far as I know this will give you every div that has the foo class.

Ext.select("div.foo");

so there might be a way to something like :


Ext.select("#myid+regex-to-check-numbers-afterward");

BernardChhun
1 Jun 2007, 4:36 AM
efege hinted me on that one!


Ext.select("div[id^='myid']")

E[foo^="bar"]: an E element whose "foo" attribute value begins exactly with the string "bar"
references : http://www.w3.org/TR/css3-selectors/

grunvald
1 Jun 2007, 5:52 AM
It works ! many thanks for your help ! :)