2014-01-02 3 views
0

Я начинаю прикосновение sencha, и я разрабатываю веб-приложение, использующее сенсор Sencha и Sencha Architect. Я использую макет вкладки. Я хочу, чтобы нижняя панель всегда показывалась. Например: http://dev.rainbowriders.dk/podcast/public/podcast.jpgХранить на табеле всегда показывать

Когда я нажимаю элемент списка. Я использовал приведенный ниже код для перехода к другому виду.

 var nav = Ext.ComponentQuery.query('#nav')[0]; 
    nav.push({ 
     xtype: 'episodes', 
     title: 'Episodes' 
    }); 

Проблема заключается в том, когда я перехожу к эпизодам view.The дно TabBar будет hidden.Like это http://dev.rainbowriders.dk/podcast/public/episodes.jpg

есть любой вид человек может сказать мне, как держать TabBar всегда показывать? Я дон Не хотите добавить представление «Эпизоды» (второй снимок экрана) в TabPanel. Потому что это должен быть просмотр в режиме просмотра подкаста (первый снимок экрана). Так что я хочу видеть результат, когда я перехожу к экрану «Эпизоды». Нижняя табло все еще показывает и удерживайте первую вкладку.

Прошу прощения за мой плохой английский. Надеюсь, я подробно разобрал свои вопросы. Ниже весь код: Общий вид

Ext.define('MyApp.view.MainView', { 
extend: 'Ext.navigation.View', 
alias: 'widget.mainview', 

requires: [ 
    'MyApp.view.MyTab' 
], 

config: { 
    itemId: 'nav', 
    navigationBar: { 
     baseCls: 'x-navigation', 
     docked: 'top', 
     itemId: 'navbar', 
     minHeight: '50px', 
     layout: { 
      align: 'end', 
      type: 'hbox' 
     }, 
     items: [ 
      { 
       xtype: 'button', 
       align: 'right', 
       centered: false, 
       hidden: false, 
       itemId: 'editPodcast', 
       ui: 'plain', 
       iconCls: 'pencil' 
      } 
     ] 
    }, 
    items: [ 
     { 
      xtype: 'mytab', 
      title: 'My Podcast' 
     } 
    ] 
} 

});

TabPanel:

Ext.define('MyApp.view.MyTab', { 
extend: 'Ext.tab.Panel', 
alias: 'widget.mytab', 

requires: [ 
    'MyApp.view.Podcast', 
    'MyApp.view.Category', 
    'MyApp.view.Setting' 
], 

config: { 
    tabBar: { 
     docked: 'bottom', 
     itemId: 'mytabbar', 
     style: 'background: #fff;border:none;', 
     layout: { 
      align: 'center', 
      type: 'hbox' 
     } 
    }, 
    items: [ 
     { 
      xtype: 'podcast', 
      itemId: 'podcast', 
      iconCls: 'music1' 
     }, 
     { 
      xtype: 'category', 
      itemId: 'category', 
      iconCls: 'home-btn' 
     }, 
     { 
      xtype: 'setting', 
      itemId: 'setting', 
      title: '', 
      iconCls: 'settings1' 
     } 
    ] 

});

Podcast Вид:

Ext.define('MyApp.view.Podcast', { 
extend: 'Ext.Container', 
alias: 'widget.podcast', 

config: { 
    ui: '', 
    layout: { 
     type: 'vbox' 
    }, 
    items: [ 
     { 
      xtype: 'toolbar', 
      flex: 1, 
      docked: 'top', 
      style: 'border: none;\r\nbackground: #8fced6;', 
      layout: { 
       align: 'center', 
       pack: 'center', 
       type: 'hbox' 
      }, 
      items: [ 
       { 
        xtype: 'searchfield', 
        itemId: 'mysearchfield', 
        width: 220, 
        label: '' 
       }, 
       { 
        xtype: 'spacer' 
       }, 
       { 
        xtype: 'segmentedbutton', 
        disabled: false, 
        itemId: 'segmentbtn', 
        ui: 'light', 
        hideOnMaskTap: false, 
        layout: { 
         align: 'center', 
         pack: 'center', 
         type: 'hbox' 
        }, 
        items: [ 
         { 
          xtype: 'button', 
          docked: 'left', 
          itemId: 'listbtn', 
          ui: 'plain', 
          iconCls: 'listview', 
          text: '' 
         }, 
         { 
          xtype: 'button', 
          docked: 'right', 
          itemId: 'boxbtn', 
          ui: 'plain', 
          iconCls: 'thumbview', 
          text: '' 
         } 
        ], 
        listeners: [ 
         { 
          fn: function(component, eOpts) { 
           var me = this; 
           me.setPressedButtons(0); 
          }, 
          event: 'initialize' 
         } 
        ] 
       } 
      ] 
     }, 
     { 
      xtype: 'container', 
      itemId: 'unplaybar', 
      style: 'border: none;\r\nbackground: #F1515F;', 
      ui: '', 
      layout: { 
       type: 'hbox' 
      }, 
      items: [ 
       { 
        xtype: 'button', 
        flex: 1, 
        itemId: 'unplayedbtnleft', 
        style: 'color: #fff;', 
        ui: 'plain', 
        width: 214, 
        labelCls: 'x-button-label unplayedlabel', 
        text: 'Unplayed Episodes' 
       }, 
       { 
        xtype: 'button', 
        itemId: 'unplayedbtnright', 
        style: 'color: #fff', 
        ui: 'plain', 
        width: 48 
       } 
      ] 
     }, 
     { 
      xtype: 'container', 
      hidden: true, 
      html: 'Podcasts', 
      itemId: 'podcastsearchtitle', 
      style: 'border: none;\r\nbackground: #f25260;\r\nheight:35px;\r\ncolor:white;\r\npadding-left:10px;', 
      ui: '', 
      layout: { 
       type: 'hbox' 
      } 
     }, 
     { 
      xtype: 'panel', 
      flex: 2, 
      hidden: false, 
      itemId: 'podcastcontent', 
      ui: '', 
      layout: { 
       animation: 'flip', 
       type: 'card' 
      }, 
      items: [ 
       { 
        xtype: 'list', 
        hidden: true, 
        itemId: 'mylist', 
        scrollable: 'vertical', 
        itemTpl: [ 
         '<img class="photo shadow" src="{podcast.thumbnail}" onerror="this.src= basicUrl + \'/img/no_img.png\';" width="60" height="60"/>', 
         '<div class="list-info">', 
         ' <div class="podcast-name">{podcast.title}</div>', 
         ' <tpl if="podcast_type === 0">', 
         '  <div class="music-toal">{episodes.total}</div>', 
         ' <tpl else>', 
         '  <div class="video-toal">{episodes.total}</div>', 
         ' </tpl>', 
         '</div>', 
         '<div class="unplayed-label">', 
         '<span >{episodes.unwatched}</span>', 
         '</div>', 
         '' 
        ], 
        store: 'PodcastStore', 
        itemHeight: 70, 
        plugins: [ 
         { 
          autoPaging: true, 
          noMoreRecordsText: ' ', 
          type: 'listpaging' 
         } 
        ] 
       }, 
       { 
        xtype: 'dataview', 
        itemId: 'mydataview', 
        margin: 5, 
        ui: '', 
        scrollable: 'vertical', 
        inline: true, 
        itemTpl: [ 
         '<div class="pview">', 
         ' <img class="shadow" src="{podcast.thumbnail}" onerror="this.src= basicUrl + \'/img/no_img.png\';" width="155" height="155"/>', 
         ' <div class="unplayed-label-box">', 
         '  <span >{episodes.unwatched}</span>', 
         ' </div>', 
         '', 
         '</div>' 
        ], 
        store: 'PodcastStore' 
       } 
      ] 
     }, 
     { 
      xtype: 'container', 
      hidden: true, 
      html: 'Episodes', 
      itemId: 'epresulttitle', 
      style: 'border: none;\r\nbackground: #f25260;\r\nheight:35px;\r\ncolor:white;\r\npadding-left:10px;', 
      ui: '', 
      layout: { 
       type: 'hbox' 
      } 
     }, 
     { 
      xtype: 'list', 
      flex: 2, 
      hidden: true, 
      itemId: 'episearchlist', 
      scrollable: 'vertical', 
      itemTpl: [ 
       '<img class="photo shadow" src="<tpl if="thumbnail == \'\'">/img/no_img.png <tpl else>{thumbnail}</tpl>" onerror="this.src= basicUrl + \'/img/no_img.png\';" width="60" height="60"/>', 
       ' <div class="list-info">', 
       '  <div class="podcast-name" title="{title}">{title}</div>', 
       '  <tpl if="type == false">', 
       '   <div class="music-box">', 
       '    <span class="music-icon-unplayed"></span><span class="music-date">{datePublished:date("m.d.Y")} {duration}</span>', 
       '   </div>', 
       '  <tpl else>', 
       '   <div class="video-box">', 
       '    <span class="video-icon-grey"></span><span class="video-date">{datePublished:date("m.d.Y")} {duration}</span>', 
       '   </div>', 
       '  </tpl>', 
       '  <div class="player"></div>', 
       ' </div>' 
      ], 
      store: 'MyEpisodeSearchStore', 
      itemHeight: 90, 
      plugins: [ 
       { 
        autoPaging: true, 
        type: 'listpaging' 
       } 
      ] 
     } 
    ] 

});

Эпизоды смотреть:

Ext.define('MyApp.view.Episodes', { 
extend: 'Ext.Container', 
alias: 'widget.episodes', 

config: { 
    itemId: 'episodes', 
    scrollable: 'vertical', 
    items: [ 
     { 
      xtype: 'toolbar', 
      docked: 'top', 
      style: 'border: none;\r\nbackground: #8fced6;', 
      items: [ 
       { 
        xtype: 'label', 
        itemId: 'podcastname', 
        style: 'color: #000;\r\nfont-size: 14px;', 
        ui: '' 
       }, 
       { 
        xtype: 'spacer' 
       }, 
       { 
        xtype: 'button', 
        itemId: 'btnsubscribe', 
        style: 'background: #fff;\r\ncolor: #2d5f73;\r\nborder: none;', 
        text: 'Subscribe' 
       }, 
       { 
        xtype: 'button', 
        itemId: 'btnunsubscribe', 
        style: 'background: #fff;color: #2d5f73;border: none;', 
        text: 'UnSubscribe' 
       } 
      ] 
     }, 
     { 
      xtype: 'list', 
      docked: 'top', 
      height: '100%', 
      itemId: 'mylist2', 
      style: 'font-size: 12px', 
      scrollable: true, 
      itemTpl: Ext.create('Ext.XTemplate', 
       ' <tpl if="episode_html == true">', 
       '   <div style="min-height: 125px;">', 
       '   <p>', 
       '    <div style="float: left; text-align:center;">', 
       '     <img width="100px" height="100px" src="{thumbnail}" onerror="this.src= basicUrl + \'/img/no_img.png\';" style="margin: 5px 10px 5px 5px;">', 
       '     <div>', 
       '      <span style="float: none" class="music-toal" id="music-num"></span>', 
       '      <span style="float: none" class="video-toal" id="video-num"></span>', 
       '     </div>  ', 
       '    </div> ', 
       '    <div class="first_des">', 
       '      {description}', 
       '    </div>', 
       '   </p>', 
       '  </div>', 
       '  <tpl else>', 
       '   <img class="photo shadow" src="<tpl if="thumbnail == \'\'">/img/no_img.png <tpl else>{thumbnail}</tpl>" onerror="this.src= basicUrl + \'/img/no_img.png\';" width="60" height="60"/>', 
       ' <div class="list-info">', 
       '  <div class="podcast-name" title="{title}">{title:this.subcat}</div>', 
       '  <tpl if="type == false">', 
       '   <div class="music-box">', 
       '    <span class="music-icon-unplayed"></span><span class="music-date">{datePublished:date("m.d.Y")} </span><span class="music-date">{duration}</span>', 
       '   </div>', 
       '  <tpl else>', 
       '   <div class="video-box">', 
       '    <span class="video-icon-grey"></span><span class="video-date">{datePublished:date("m.d.Y")}</span>', 
       '   </div>', 
       '  </tpl>', 
       '  <div class="player"></div>', 
       ' </div>', 
       ' </tpl>', 
       '', 
       { 
        subcat: function(value) { 
         if(value.length > 40){ 
          return value.slice(1,40)+"..."; 
         }else{ 
          return value; 
         } 
        } 
       } 
      ), 
      store: 'EpisodesStore', 
      itemHeight: 90, 
      plugins: [ 
       { 
        autoPaging: true, 
        type: 'listpaging' 
       } 
      ] 
     } 
    ] 

});

+0

введите здесь свой код целиком. этот фрагмент кода, который не имеет смысла. Например, что вы использовали для создания вкладки! –

+0

Спасибо Огуз за вашу помощь.и выгрузили весь код. –

ответ

0

Попробуйте это и дайте мне знать результат.

config: { 
tabBar: { 
    docked: 'bottom', 
    itemId: 'mytabbar', 
    style: 'background: #fff;border:none;', 
    layout: { 
     pack: 'center' 
    } 
}, 

Попробуйте эту скрипку, это нормально?

Dock Sample

+0

Hi Oğuz.it не работает –

+0

Гэвин, попробуйте скрипку, которую я разместил. –

Смежные вопросы