Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get all elements of a specific type using ExtJS

Hello I have been using JQuery for quite a while. I need to get the ids of the checked elements. I have all my checkboxes as rows sitting inside a container, and I want to get the ids of all the checkboxes that have are checked.

I would use

$("#container input:checkbox") 

to get all the checkboxes in that container, and then would check for which ones have been checked.

To do the same in ExtJS, i have been using the "get" method, and would do a

Ext.get('input')

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

like image 557
macha Avatar asked Mar 28 '11 20:03

macha


1 Answers

The equivalent function to JQuery's selector would be either Ext.query, or Ext.DomQuery.selectNode.

Ext.Query works in a very similar way as JQuery (see how the selectors work here).

In your case, you could try this:

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

Of course, this will only obtain DOM values rather than Ext components.

like image 177
NT3RP Avatar answered Oct 18 '22 02:10

NT3RP