开发者

jQuery to Ext conversion

What's the equivalent of $('#id.class:inp开发者_C百科ut') in Ext? Or is there?


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');


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜