2013-07-01 73 views
0

我回到目錄查看器應用程序的項目,並更新到最後煎茶發佈後,我也有同樣的問題,我有一對夫婦的一個月前...傳送帶唐無法識別onTap事件,否則無法正確加載。煎茶觸摸轉盤2.2.1不inizialized

該應用程序相當簡單,結構如下:

  • 公司名稱
    • 目錄列表
      • detailcard與目錄頁(3每行​​)
        • 旋轉木馬從頁開始挖掘

,當我使用的應用程序不能與煎茶CMD編譯事實上,它很順利地工作,problemless,但是當我構建應用程序(也生產和包裝)與煎茶CMD,它贏得沒有工作。

數據視圖顯示所有圖像,當我點擊其中的一個,它彈出的旋轉木馬,而空。我試圖調試,它不會進行初始化,但爲什麼只在構建版本?

的代碼,我用的是以下幾點:

Ext.define('CIAM_app.view.Cataloghi', { 
extend: 'Ext.NestedList', 
xtype: 'cataloghi', 
requires: ['Ext.data.TreeStore', 'Ext.carousel.Carousel'], 
fullscreen: true, 
config: { 
    iconCls: 'doc', 
    iconMask: true, 
    title: 'Cataloghi', 
    styleHtmlContent: true, 
    store: 'lista_cataloghiStore', 
    variableHeights: true, 
    listConfig: { 
     itemTpl: '<tpl if="leaf == false"><img src="{icon}" alt="{text}" class="cataloghi_img" /></tpl><tpl if="leaf == true"><p class="cataloghi_p">{text}</p></tpl>', 
    }, 
    listeners: { 
     leafitemtap: function(nestedList, list, index, target, record) { 
      var detailCard = nestedList.getDetailCard(); 
      var pagina = record.get('immagini_catalogo'); 
      var n = record.get('pagine_catalogo'); 
      items = []; 
      if (detailCard.getData() != null) { 
       detailCard.getStore().removeAll(true, true); 
      } 
      for (i = 1; i <= n; i++) { 
       items.push({ 
        src: 'gallery/' + pagina + '/' + i + '.jpg', 
       }); 
      } 
      detailCard.setData(items); 
      detailCard.refresh(); 
     }, 
    }, 
    detailCard: { 
     xtype: 'dataview', 
     itemTpl: '<img src="{src}">', 
     cls: 'immagine_catalogo', 
     listeners: { 
      itemtap: function(dataView, index, target, record, e, eOpts) { 
       Ext.Viewport.add({ 
        xtype: 'carousel', 
        extend: 'Ext.Carousel', 
        defaultType: 'image', 
        initialize: function() { 
         this.setItems(dataView.getData()); 
         this.setActiveItem(index); 
         this.callParent(); 
         this.element.on('tap', this.onTap, this); 
        }, 
        onTap: function(e, t) { 
         this.fireEvent('tap', this, e, t); 
         this.hide(); 
        }, 
        style: { 
         'background': 'rgba(206,203,203,0.87)' 
        }, 
        indicator: false, 
        width: '100%', 
        height: '100%', 
        centered: true, 
        fullscreen: true, 
        modal: true, 
        hideOnMaskTap: true, 
        showAnimation: { 
         type: 'popIn', 
         duration: 250, 
         easing: 'ease-out' 
        }, 
        hideAnimation: { 
         type: 'popOut', 
         duration: 250, 
         easing: 'ease-out' 
        }, 
       }).show(); 
      } 
     } 
    } 
} 
}); 

如果你想看到的Web應用程序,這裏的鏈接:http://www.ciamcostruzioni.it/CIAM_app/not_compiled/

在此先感謝。

回答

0

我對你的代碼做了一些修改。檢查它:

http://jsfiddle.net/JCarlesVilaseca/NZj3N/

Ext.define('CIAM_app.view.Cataloghi', { 
    extend: 'Ext.NestedList', 
    xtype: 'cataloghi', 
    requires: ['Ext.data.TreeStore', 'Ext.carousel.Carousel'], 
    fullscreen: true, 
    config: { 
     iconCls: 'books', 
     iconMask: true, 
     title: 'Cataloghi', 
     styleHtmlContent: true, 
     store: Ext.create('CIAM_app.store.lista_cataloghiStore'), 
     variableHeights: true, 
     listConfig: { 
      itemTpl: '<tpl if="leaf == false"><img src="http://www.ciamcostruzioni.it/CIAM_app/not_compiled/{icon}" alt="{text}" class="cataloghi_img" /></tpl><tpl if="leaf == true"><p class="cataloghi_p">{text}</p></tpl>' 
     }, 
     listeners: { 
      leafitemtap: function(nestedList, list, index, target, record) { 
       var detailCard = nestedList.getDetailCard(); 
       var pagina = record.get('immagini_catalogo'); 
       var n = record.get('pagine_catalogo'); 
       items = []; 
       if (detailCard.getData() !== null) { 
        detailCard.getStore().removeAll(true, true); 
       } 
       for (i = 1; i <= n; i++) { 
        items.push({ 
         src: 'http://www.ciamcostruzioni.it/CIAM_app/not_compiled/gallery/' + pagina + '/' + i + '.jpg' 
        }); 
       } 
       detailCard.setData(items); 
       detailCard.refresh(); 
      } 
     }, 
     detailCard: { 
      xtype: 'dataview', 
      itemTpl: '<img src="{src}">', 
      cls: 'immagine_catalogo', 
      listeners: { 
       itemtap: function(dataView, index, target, record, e, eOpts) { 
        Ext.Viewport.add({ 
         xtype: 'catalogues_carousel', 
         listeners: { 
          initialize: function() { 
           this.setItems(dataView.getData()); 
           this.setActiveItem(index); 
          } 
         } 
        }).show() 
       } 
      } 
     } 
    } 
}); 

Ext.define('CIAM_app.view.Cataloghi_carousel', { 
    extend: 'Ext.Carousel', 
    xtype: 'catalogues_carousel', 
    requires: ['Ext.carousel.Carousel'], 

    config: { 
     fullscreen: true, 

     defaultType: 'image', 

     style: { 
      'background': 'rgba(206,203,203,0.87)', 
      'z-index':10 
     }, 
     indicator: false, 
     modal: true, 
     showAnimation: { 
      type: 'popIn', 
      duration: 250, 
      easing: 'ease-out' 
     }, 
     hideAnimation: { 
      type: 'popOut', 
      duration: 250, 
      easing: 'ease-out' 
     } 
    }, 

    initialize: function() { 
     this.element.on('tap',function() { 
      this.hide(); 
     }); 
    } 
}); 
+0

太謝謝你了!只是編譯測試和工作得很好!!!! – guglio

+0

轉盤沒有得到的z-index值,導航菜單已經結束了,所以我從款式取出,直接在「catalogues_carousel」 zIndex的的配置提出:10,我也改變模式爲false。我無法工作的唯一的事情就是淡出動畫,沒什麼大不了的,但它是一種眼光。 – guglio

+0

不要忘記投票! –