user2345998
user2345998

Reputation: 649

ExtJS - Select visible element using Ext.dom.Query

I want to select elements with a specific class, but only when they are visible. I'm trying to do this using Ext.dom.Query. According to this documentation, it should be possible using CSS value selectors.

I tried it with the following seletor

Ext.query('.x-box-scroller{display=none}')

but it results in an

SyntaxError: An invalid or illegal string was specified

Many thanks for your help!

Upvotes: 0

Views: 3076

Answers (1)

Bugs Bunny
Bugs Bunny

Reputation: 2674

To avoid syntax error, try using different brackets:

Ext.query('.x-box-scroller[display=none]')

To select only invisible elements, I would go with:

Ext.query('.x-box-scroller[style*="display: none"]')

To select only visible elements:

Ext.query('.x-box-scroller:not([style*="display: none"])')

Upvotes: 1

Related Questions