- 浏览: 802534 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (360)
- Java (101)
- JPA/Hibernate (10)
- Spring (14)
- Flex/BlazeDS (37)
- Database (30)
- Lucene/Solr/Nutch (0)
- Maven/Ant (25)
- CXF/WebService (3)
- RPC/RMI/SOAP/WSDL (1)
- REST (6)
- TDD/BDD/JUnit (1)
- Servlet/JSP (2)
- AI/MachineLearning (3)
- Resource (1)
- 字符编码 (2)
- OOA/OOPS/UML (5)
- DesignPattern (8)
- 算法与数据结构 (11)
- Web&App Server (13)
- 并发&异步&无阻塞 (7)
- Entertainment (4)
- JavaScript/ExtJS (45)
- CodeStyle&Quality (1)
- svn/git/perforce (8)
- JSON (2)
- JavaScriptTesting (4)
- Others (6)
- RegularExpression (2)
- Linux/Windows (12)
- Protocal (2)
- Celebrities (1)
- Interview (1)
- 计算机语言 (1)
- English (2)
- Eclipse (5)
- TimeZone/时区 (1)
- Finance (1)
- 信息安全 (1)
- JMS/MQ (2)
- XSD/XML/DTD (3)
- Android (4)
- 投资 (3)
- Distribution (3)
- Excel (1)
最新评论
-
qdujunjie:
如果把m换成具体的数字,比如4或者5,会让读者更明白
m阶B树中“阶”的含义 -
java-admin:
不错,加油,多写点文章
关于Extjs的mixins和plugin -
xiehuaidong880827:
你好,我用sencha cmd打包完本地工程后,把app.js ...
ExtJS使用Sencha Cmd合并javascript文件为一个文件 -
KIWIFLY:
lwpan 写道inverse = "true&qu ...
Hibernate中什么时候使用inverse=true -
luedipiaofeng:
good
消除IE stop running this script弹出框
Ext.create provides a higher level control for instantiation throughout. It's best practice from Ext JS 4 onwards to use it over the 'new' keyword, since it's tightly coupled with Ext.Loader which makes dependency resolution much easier. During development the target class will be automatically loaded synchronously the first time it's used, which frees you from having to remember "Ext.require-ing" it before-hand.
Besides, just like Ext.require, Ext.create accepts either a class name or an alias, which makes it extremely convenient to instantiate almost everything in Ext JS 4 library by its xtype / type without having to figure out its full class name up front, for example:
Debugging is much more easier. If you try to instantiate a nonexistent class with the 'new' keyword, it's painful to figure out quickly what's going on with "TypeError: undefined is not a function", for example, try:
instead
gives you:
[Ext.create] Cannot create an instance of unrecognized class name / alias: Ext.data.proxy.JsonD
We've heavily optimized it internally for the best performance possible, and extreme benchmarks prove no considerable hit on performance over thousands of objects.
Another robust feature with Ext.create that can't be simply achieve with the 'new' keyword is it enables instantiation with variable arguments. For example:
Which is not possible with:
参考:
http://www.sencha.com/forum/showthread.php?127671-Ext.create-vs-the-keyword-new
Besides, just like Ext.require, Ext.create accepts either a class name or an alias, which makes it extremely convenient to instantiate almost everything in Ext JS 4 library by its xtype / type without having to figure out its full class name up front, for example:
Ext.create('widget.combobox'); // instead of Ext.create('Ext.form.field.ComboBox') Ext.create('proxy.jsonp'); // instead of Ext.create('Ext.data.proxy.JsonP')
Debugging is much more easier. If you try to instantiate a nonexistent class with the 'new' keyword, it's painful to figure out quickly what's going on with "TypeError: undefined is not a function", for example, try:
new Ext.data.proxy.JsonD
instead
Ext.create('Ext.data.proxy.JsonD')
gives you:
[Ext.create] Cannot create an instance of unrecognized class name / alias: Ext.data.proxy.JsonD
We've heavily optimized it internally for the best performance possible, and extreme benchmarks prove no considerable hit on performance over thousands of objects.
Another robust feature with Ext.create that can't be simply achieve with the 'new' keyword is it enables instantiation with variable arguments. For example:
Ext.create.apply(null, ['My.ClassName', arg1, arg2, arg3, ...]);
Which is not possible with:
new My.ClassName({list of arguments must be known here});
参考:
http://www.sencha.com/forum/showthread.php?127671-Ext.create-vs-the-keyword-new
发表评论
-
Fiddler使用
2017-06-22 16:27 653Fiddler不能捕获chrome request 原因是,c ... -
Javascript跨域
2017-06-21 17:05 623在js中,我们直接用XMLHttpRequest请求不同域上 ... -
面向对象的JavaScript,ECMAScript6, ECMAScript2015
2017-02-11 21:11 559全面理解面向对象的 JavaScript http://www ... -
SASS用法指南
2016-03-03 14:18 699SASS用法指南 http://www.ruanyifeng. ... -
Angular JS与ExtJS比较
2016-01-04 13:54 1619ExtJS vs AngularJS http://www.t ... -
ExtJS POST请求客户端服务端案例
2015-11-10 15:29 1255客户端GUI端示例 var positionIDList = ... -
Javascript设计模式
2015-09-29 14:12 821书名:Learning JavaScript Design P ... -
JavaScript单例模式Singleton Pattern
2015-09-29 14:10 1364参考链接:http://www.dofactory.com/j ... -
Check scope of element in Angular JS
2015-06-16 15:36 765step 1) choose an element in de ... -
有意思的HTML5效果
2015-03-18 09:24 1246http://www.html5tricks.com/9-fu ... -
JavaScript内存溢出
2015-02-13 10:42 1097http://javascript.info/tutorial ... -
JavaScript Variable Scope and Closure(闭包)
2015-02-11 09:52 929参考文章: http://javascript.info/tu ... -
JavaScript电子相册
2015-02-05 09:36 1797http://www.webhek.com/misc/3d-a ... -
JavaScript学习笔记
2015-01-11 10:59 815Repeated and Omitted Declaratio ... -
JavaScript小技巧
2014-12-26 10:00 883关系javascript变量的内存 ... -
JavaScript TimeZone issue
2014-10-31 11:48 0Tue Jan 01 2008 23:45:00 GMT+03 ... -
转义字符处理,获取字符的ASCII码值
2014-10-24 13:58 2026Java 获取字符的ASCII码值 int asciiDec ... -
JavaScript技巧,最佳实践(Best Practice)
2014-10-20 10:03 68045个实用的JavaScript技巧、窍门和最佳实践 http ... -
如何跨域获取Cookie
2014-06-23 14:32 3131cookie可以跨子域访问,如果用户信息保存在qq.com的c ... -
JavaScript获取图片(Image)的大小(宽度,高度)
2014-05-13 17:46 1900如果只有图片的URL function getImageD ...
相关推荐
Ext.create('Ext.form.ComboBox', { fieldLabel: 'AutoComplete', store: { fields: ['id', 'name'], proxy: { type: 'ajax', url: 'auto_complete.jsp', // Java后端接口 reader: { type: 'json', ...
5. **实例化对象的方式**:推荐使用`Ext.create`函数代替`new`关键字创建对象,如`var win = Ext.create("Ext.window.Window", {...})`。这种方式更利于依赖注入和动态加载。 6. **动态类加载**:引入了`Ext.Loader...
var parentStore = Ext.create('Ext.data.Store', { /* ... */ }); var parentComboBox = Ext.create('Ext.form.field.ComboBox', { store: parentStore, displayField: 'name', valueField: 'id', listeners:...
var treeLoader = new Ext.tree.DWRTreeLoader({ url: 'dwr/call/plaincall/TreeManager.getTreeNodes.js' }); var tree = new Ext.tree.TreePanel({ loader: treeLoader, autoScroll: true, ...
在ExtJS中,饼图可以通过`Ext.chart.Chart`类和`Ext.chart.series.Pie`系列配置来创建。你可以设置各个扇区的颜色、标签和值,还可以添加交互性,如点击扇区时显示详细信息。例如,你可以通过以下代码创建一个简单的...
var cm = new Ext.grid.ColumnModel({ columns: [ {header: '姓名', dataIndex: 'name', flex: 1}, { header: '生日', sortable: true, dataIndex: 'birthday', renderer: Ext.util.Format.dateRenderer...
- 这个类继承自`Ext.form.field.Date`,并通过添加新的配置选项和方法来实现时间和日期的综合选择。 - **依赖组件**:`Ext.zc.form.DateTimePicker` - 此组件负责展示日期时间选择器界面,提供用户交互操作。 ###...
通过结合使用`Ext.picker.Date`和`Ext.picker.Time`,并结合适当的配置和事件处理,你可以创建出符合项目需求的日期时间选择界面。附件中的css、js和测试样例文件将有助于更好地理解和应用这些控件。
store: Ext.create('Ext.data.Store', {data: data}), itemSelector: 'div' }); Ext.getCmp('container').add(list); // 假设有一个id为'container'的容器 } }); }); ``` 综上所述,EXTJS的事件系统和模板...
首先需要创建一个`Ext.data.Store`实例,这是Extjs中用于存储和管理数据的核心对象。在创建Store时,需要设置分页参数`pageSize`以控制每页显示的数据数量,并定义模型(Model)以及数据代理(Proxy)等配置。 ```...
var myButton = Ext.create('widget.button', { text: 'Click me', handler: function() { alert('Button clicked!'); } }); ``` #### Xtype检查方法 Ext JS还提供了检查Xtype的方法,如`getXType`和`isXType`...
var displayTpl = new Ext.XTemplate('<tpl for="."><div class="x-boundlist-item">{name}</div></tpl>'); combo.displayTpl = displayTpl; ``` 此外,为了提高用户体验,你可能希望添加清除已选值的功能。为此,...
var newNode = Ext.create('Ext.data.Model', { text: '新节点', leaf: false, // 如果是父节点,设置为false iconCls: 'someIconClass' // 可选,为节点设置图标类 }); ``` 4. **插入节点** 插入新节点有两...
this.getGoodswinview().setTitle(Ext.util.Format.date(new Date(),'Y-m-d H:i:s')); } } }); }, showWin : function(){ Ext.create('keel.view.goods.GoodsWinView').show(); } });
var ptree = new Ext.tree.TreePanel({ // ... }); ``` 而在 ExtJS4 中,我们需要使用以下代码来创建一个 TreePanel: ```javascript var ptree = Ext.create('Ext.data.TreeStore', { // ... }); ``` 可以看到...
var store = Ext.create('Ext.data.Store', { fields: ['name', 'email'], data : [ { name: 'Lisa', email: 'lisa@simpsons.com' }, { name: 'Bart', email: 'bart@simpsons.com' } ] }); var grid = new Ext...
标签中提到的“源码”和“工具”提示我们,理解`Ext Composite`的工作原理,可以通过阅读其源代码,这对于深度定制和优化性能非常有帮助。同时,利用调试工具(如Chrome DevTools)可以帮助我们更好地理解事件传播...
me.treeStore = Ext.create('Ext.data.TreeStore', { fields: ['nid', 'id', 'name', 'sex', 'age'], proxy: { type: 'ajax', url: YZSoft.$url('YZSoft.Services.REST/BPM/Process.ashx'), extraParams: { ...