Sencha Touch: how to add a table view as rootView in left side & a view with a button as detailsView in right side of this split view in sencha touch

故事扮演 提交于 2019-12-11 05:08:54

问题


I have implemented an app in iphone using sencha touch & phone gap.

Implemented split view using following code in index.js in SRC file with two text messages.. as shown bellow figure

Now i need to add a table view on left side root view and a button on right side details view. how?

Thanks in advance

Ext.ns('sink', 'demos', 'Ext.ux');
Ext.ux.UniversalUI = Ext.extend(Ext.Panel,
                                {
                                  fullscreen: true,
                                  layout: 'hbox',
                                  items:

                                  [
                                     //Root view 
                                     {
                                       xtype: 'panel',
                                       html: 'TableView/Rootview goes here ...',
                                       flex: 1
                                   },

                                    //Details view
                                   {
                                       xtype: 'panel',
                                        html: 'Message Detail view goes here ....',
                                       flex: 2
                                   }
                                  ]

                                });


回答1:


Currently your rootView and detailView are all of xtype: 'panel'. To achieve what you need, you have to modify a little bit to those 2 items:

  • For the root view, actually it's called GridView, please read this for more details: http://www.sencha.com/forum/showthread.php?150431-Ext.ux.touch.grid
  • For the detail view, it's simple to create a view with a button, for example (just example, might not exactly be what you need):
{
    xtype: 'container',
    items: [
      {xtype: 'button', text: 'my button'},
      {xtype: 'panel', text: 'detail panel'}.
    ]
}


来源:https://stackoverflow.com/questions/10650697/sencha-touch-how-to-add-a-table-view-as-rootview-in-left-side-a-view-with-a-b

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!