Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript sencha触摸负载手动存储_Javascript_Extjs_Sencha Touch - Fatal编程技术网

Javascript sencha触摸负载手动存储

Javascript sencha触摸负载手动存储,javascript,extjs,sencha-touch,Javascript,Extjs,Sencha Touch,简单用例:我想在加载存储时手动控制。加载存储时,我希望数据填充列表。然而,我无法让它工作 当我在商店里把autoLoad设置为true时,它就工作了。如果我删除自动加载,并将其添加到视图中,则不会发生任何事情 列表配置: { xtype: 'list', fullscreen: true, disableSelection: true, store: 'NewsStore', itemId: 'newsList', itemTpl: '<li>&l

简单用例:我想在加载存储时手动控制。加载存储时,我希望数据填充列表。然而,我无法让它工作

当我在商店里把autoLoad设置为true时,它就工作了。如果我删除自动加载,并将其添加到视图中,则不会发生任何事情

列表配置:

{
   xtype: 'list',
   fullscreen: true,
   disableSelection: true,
   store: 'NewsStore',
   itemId: 'newsList',
   itemTpl: '<li><strong>{date} - {title}</strong><br/>{text}</li>',
   plugins: [
   {
       xclass: 'Ext.ux.touch.PullRefreshFn',
       pullText: 'Henter nyheter',
       refreshFn: function () {
           Ext.getStore('NewsStore').load();
       }
   }
]}

我尝试使用load方法的回调。我试图从列表中获取存储并更新它,但没有任何效果列表只是空的,没有显示任何内容,即使我可以看到代码正在获取信息。知道我做错了什么吗?

您必须使用setStore属性来填充数据

var myStore = Ext.getStore('NewsStore');

Now access the list object and just 

mylist.setStore(myStore);

如何将存储绑定到视图?最好能看到完整视图配置。添加了列表配置。它实际上只是一个以列表为内容的外部面板。我甚至尝试在列表的store属性中执行Ext.createstore,但这也不起作用。
var myStore = Ext.getStore('NewsStore');

Now access the list object and just 

mylist.setStore(myStore);