Pregunta

I am trying to find an example of an Ext JS component query which searches for items with more than one class.

This is the standard to find a component by class:

Ext.Component.query('panel[cls~=my-cls]')

I want to do something like:

Ext.Component.query('panel[cls~=my-cls && cls~=my-other-cls]')

Anyone have an example of this?

Thanks

btw, the component might have say 10 classes, but I only want to specify 2 it should contain e.g.

cls: 'ths tht r1 c1'

find components with both 'r1 & c1'

¿Fue útil?

Solución

What version of Ext JS are you referring to? 4.1.2?

You should be able to chain atribute searches (tested in Ext JS 4.1.1, no ~= operator yet):

Ext.ComponentQuery.query("panel[cls~=my-cls][cls~=my-other-cls]")
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top