extjs中的ComponentQuery方法
2016-02-16 16:44
603 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <link rel="stylesheet" type="text/css" href="../ext-4.2.1.883/resources/css/ext-all.css"/> <script type="text/javascript" src="../ext-4.2.1.883/bootstrap.js"></script> <script> Ext.onReady(function(){ var viewport=Ext.create("Ext.container.Viewport",{ layout:"fit", renderTo:Ext.getBody(), items:[{ xtype:'panel', title:'panel1', itemId:'p1', items:[{ xtype:'button', text:'button1' },{ xtype:'button', text:'button2' },{ xtype:'panel', title:'panel2', items:[{ xtype:'button', text:'button3' },{ xtype:'button', text:'button4' }] }] }] }); buttons1=Ext.ComponentQuery.query('#p1>button');//查出的数组中包括button1,button2 buttons2=Ext.ComponentQuery.query('#p1 button');//查出的数组中包括button1,button2,button3,button4 //由此可见>是查出容器内根子节点的所有button,不带>则是查询出容器内所有子节点内的button console.log(buttons1); console.log(buttons2); }); </script> </head> <body> </body> </html>
相关文章推荐
- 【乐意黎原创】Sublime Text 3 build 3103 license 四个供研究使用
- 安卓UI设计实例教程打包
- poj 2524 Ubiquitous Religions
- 8VC Venture Cup 2016 -A - Robot Sequence/B - Cards
- Java基础——数组应用之StringBuilder类和StringBuffer类
- ContentValues的用法
- UITabBarController自定义一
- NGUI制作字体的三种方法
- Kbuild
- iPads和iPhones的Media Queries
- UICollectionView使用以及与UITableView的区别
- JAVA 生成uuid
- IOS学习 UIView 页面布局
- SOUI GDI+渲染引擎下的字体特效
- iOS对UIView对象或子类对象截屏(截取的内容以UIImage的形式存储)
- UICollectionView基础
- 降低对象的引用级别到软引用 class SoftValueMap<K, V> extends HashMap<K, V>
- nyoj--1100--WAJUEJI which home strong!(bfs)
- nyoj--1100--WAJUEJI which home strong!(bfs)
- android 开源组件合集-UI篇(2014-08-25更新)