Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.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
Image 从Sencha Touch 2的缩略图库中推送新的全尺寸图像视图_Image_Extjs_Sencha Touch 2_Gallery_Push - Fatal编程技术网

Image 从Sencha Touch 2的缩略图库中推送新的全尺寸图像视图

Image 从Sencha Touch 2的缩略图库中推送新的全尺寸图像视图,image,extjs,sencha-touch-2,gallery,push,Image,Extjs,Sencha Touch 2,Gallery,Push,我目前正在使用Sencha Touch 2创建图像库。我已经成功地从主图库中的JSON存储区加载了这些图像,其中包含图像的缩略图。我希望能够让用户单击/点击主图库中的每个图像,并让点击事件将图像推送到新视图中,该视图将以全尺寸显示图像 目前,我的观点是: Ext.define("tumblrPhotos.view.SampleView", { extend: 'Ext.dataview.DataView', xtype:'sampleviewtest', requires: [ 'tum

我目前正在使用Sencha Touch 2创建图像库。我已经成功地从主图库中的JSON存储区加载了这些图像,其中包含图像的缩略图。我希望能够让用户单击/点击主图库中的每个图像,并让点击事件将图像推送到新视图中,该视图将以全尺寸显示图像

目前,我的观点是:

Ext.define("tumblrPhotos.view.SampleView", {
extend: 'Ext.dataview.DataView',
xtype:'sampleviewtest',
requires: [
    'tumblrPhotos.store.PhotoStore',
],

config: {
    title: 'Photos',
    layout: 'card',
    id: 'gallerythumbnail',
    store: 'PhotoStore',
    styleHTMLContent: true,
    fullscreen: true,
    scrollable: 'vertical',
    baseCls: 'gallery-image',
    itemTpl: new Ext.XTemplate ([
        '<div class="gallery-thumbnail">',
        '<tpl for="photos[0].alt_sizes[0]">',
            '<img src="{url}" class="test" />',
        '</tpl>',
        '</div>'
    ].join('')
    ),
},  

});

非常感谢所有能帮助我的人!我真的很感激

根据您的评论,错误相对明显

Ext.ComponentManager.get('galleryview')
…不返回任何内容

在Sencha Touch的API文档中,我看到Ext.ComponentManager是一个私有类,所以您真的不应该使用它。也许您应该使用Ext.ComponentQuery或其他方法来获取该组件的一部分

考虑到您已经为控制器上的xtype定义了一个“ref”,您可以使用自动创建的getter(我认为在您的例子中是getNav())


最后但并非最不重要的一点是,您没有发布该特定组件(galleryview)的任何代码,因此除了我刚才所说的之外,我无法真正进行推测。

您能定义“不工作”吗?有什么事发生吗?你看到错误了吗?当然!这是我在Javascript控制台中得到的:Uncaught TypeError:无法调用未定义的方法“push”。错误出现在控制器的“viewFullScreen”函数中。请显示
galleryview
类。我建议您将断点放在这一行,并查看
Ext.getCmp('galleryviewid')
Ext.getCmp('galleryview')
Ext.get('galleryview')
返回的内容
Ext.ComponentManager.get('galleryview')