码迷,mamicode.com
首页 > Web开发 > 详细

为什么Extjs继承Ext.data.Store不起作用

时间:2015-12-23 02:03:53      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:

为什么Extjs继承Ext.data.Store不起作用:
引起继承不起作用的原因可能是多种多样的,下面就分析其中的一种,或许能够对有类似情况的有所帮助。

 

DocStore = Ext.extend(Ext.data.Store,{ 
 initComponent:function(){ 
  this.proxy = new Ext.data.HttpProxy({url:this.url}); 
  this.reader = new Ext.data.JsonReader( 
   { 
     totalProperty: ‘results‘, 
     root: ‘rows‘, 
     id:‘docid‘, 
     fields: [‘docid‘, ‘extention‘,‘docname‘, ‘author‘, ‘sizes‘, ‘datecreated‘] 
   } 
  ); 
  this.sortInfo = { field: ‘datecreated‘, direction: ‘DESC‘ }; 
  this.remoteSort = false; 
  DocStore.superclass.initComponent.call(this); 
 } 
});

 

没有实现继承的原因是:Ext.data.Store类没有继承component组件 因此在初始化的时候不会调用initComponet方法, 因此这里面的配置项也不会加载到Store里面。 

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=8193

更多内容可以参阅:http://www.softwhy.com/javascript/

 

为什么Extjs继承Ext.data.Store不起作用

标签:

原文地址:http://www.cnblogs.com/softwhy/p/5068661.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!