複数の指定されたクラスを含むコンポーネントをExt JSに検索する方法は?

StackOverflow https://stackoverflow.com//questions/12652615

  •  11-12-2019
  •  | 
  •  

質問

複数のクラスを持つアイテムを検索するEXT JSコンポーネントクエリの例を見つけようとしています。

これはクラスによってコンポーネントを見つけるための標準です:

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

私は次のようにしたいのですが:

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

誰もがこれの例を持っていますか?

ありがとう

BTW、コンポーネントは10クラスと言っているかもしれませんが、2を指定したいだけです。

cls: 'ths tht r1 c1'
.

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]")
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top