Get all elements of a specific type using ExtJS

Hello, I have been using jQuery for a long time. I need to get the identifiers of checked items. I have all my flags in the form of strings located inside the container, and I want to get the identifiers of all the checked flags.

I would use

$("#container input:checkbox") 

to get all the checkboxes in this container, and then check which ones were checked.

To do the same in ExtJS, I used the get method and did

 Ext.get('input') 

which gives me all the input elements, but I still need to check if they are of type "checkbox", is there a way to get only the flag elements from the DOM?

+7
source share
2 answers

The equivalent function for a jQuery selector will be either Ext.query or Ext.DomQuery.selectNode .

Ext.query works just like jQuery ( see how selectors work ).

In your case, you can try the following:

 Ext.query("#container input:checked") 

Of course, this will only get DOM values, not Ext components.

+7
source

If you use the CheckboxGroup object, you can use the getValues ​​() method, which will return an array of checkboxes that you can use to view the values ​​...

+1
source

All Articles