How to find components containing more than one specified class in Ext JS?
-
11-12-2019 - |
문제
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
'
해결책
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]")
제휴하지 않습니다 StackOverflow