PDA

View Full Version : Ext.DomQuery.compile doesn't handle multiple attributes



wbenroy
8 Oct 2012, 1:58 PM
This works:

Ext.DomQuery.compile('node[@attr1="value1"]')

But this doesn't:

Ext.DomQuery.compile('node[@attr1="value1" and @attr2="value2"]')

evant
8 Oct 2012, 3:00 PM
See: http://www.w3.org/TR/selectors/#attribute-selectors

Specifically:



Multiple attribute selectors can be used to represent several attributes of an element, or several conditions on the same attribute. Here, the selector represents a span element whose hello attribute has exactly the value "Cleveland" and whose goodbye attribute has exactly the value "Columbus":

span[hello="Cleveland"][goodbye="Columbus"]

wbenroy
9 Oct 2012, 3:32 AM
D'oh! I was thinking XPath. Thanks!