tags:

views:

75

answers:

2

What's the equivalent of $('#id.class:input') in Ext? Or is there?

+3  A: 

My guess based on this reference Extjs quick start guide for jQuery Developers

// Select elements with CSS Selector
var elem = Ext.select("#id.class:input");

// or select directly from an existing element
var members = Ext.get('id');
var elem = members.select('input.class');
o.k.w
+1  A: 

I think you're looking for Ext.query('#id.class:input') but whether Ext's CSS selector engine is robust enough to handle that particular request, I'm not sure off the top of my head. Probably, it is. In any case, the documentation says it returns an array of DOM elements that match your selector.

Edit: o.k.w. is right, too. query returns raw DOM elements, while select returns a CompositeElement, which is closer to the way jQuery does things.

Joel Mueller
I think Joel might be right too, after reading this: http://www.chnorton.com.au/2008/01/31/adventures-with-extjs-and-jquery/
o.k.w
Haha well, for jQuery guys, "query" seems to be more intuitive. +1
o.k.w
BTW,which of them has a longer history?
My guess is ExtJS first. But I wouldn't compare them directly.
o.k.w