Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selecting elements that do not contain a certain ID using ExtJS

I'm trying to select all the <input> elements of a form except ones with IDs containing the words foo or bar. How can I do this using ExtJS 2.3.0? I've tried the following:

Ext.query("select,input:not([id*=foo][id*=bar])", "SomeForm");`

... but it doesn't work. Excluding IDs with foo in them seems to work fine:

Ext.query("select,input:not([id*=foo])", "SomeForm")`

I'm just not sure how to add a second ID substring. Any Ideas?

like image 674
pmdarrow Avatar asked Jul 21 '26 00:07

pmdarrow


2 Answers

Not sure how to combine a selector like this but I think if you use the filter function you can filter out the first query:

Ext.DomQuery.filter(Ext.query('input:not([id*=foo])','SomeForm'),'input:not([id*=bar])');

Notice that I just played around a bit more with this and that function works:

Ext.query('input:not([id*=foo]):not([id*=bar])');

but this gives me the same error you mentionned:

Ext.query('input:not([id*=foo]):not([id*=bar])','SomeForm');

So it seems to me like a bug with the ExtJS query function when you pass a specific root with multiple attribute selectors.

like image 168
SBUJOLD Avatar answered Jul 23 '26 14:07

SBUJOLD


Ext.query("select,input:not([id*=foo]):not([id*=bar])", "SomeForm")` try this

like image 35
sushil bharwani Avatar answered Jul 23 '26 14:07

sushil bharwani