Results 1 to 4 of 4

Thread: Menu + Dataviews

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2014
    Location
    Finland
    Posts
    19
    Answers
    2

    Default Menu + Dataviews

    Hi,

    I'm trying to build menu (Ext.Menu) with multiple dataviews in vertical order and then there is few labels between the dataviews. Everything looks fine except that the menu can be only scrolled from the Label items.

    Any ideas how this could be fixed?

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Difficult to say without seeing some code (at least for me). This is the modern toolkit?

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2014
    Location
    Finland
    Posts
    19
    Answers
    2

    Default

    Quote Originally Posted by Gary Schlosberg View Post
    Difficult to say without seeing some code (at least for me). This is the modern toolkit?
    Yes, Modern toolkit.

    Code:
            var template = new Ext.XTemplate('<div class="layeritem"><img src="{img}"/><label for="{name}">{label}</label><input id="{name}" type="checkbox"',
                '<tpl if="checked == true">checked</tpl>/></div>'
            );
    
    
            if (me.menu == null || me.recreateMenu) {
                me.menu = Ext.create('Ext.Menu', {
                    width: '80%',
                   // height: '100%',
                    borderBorder: false,
                    border: false,
                    scrollable: 'y',
                    listeners: {
                        hide: me.onMenuHide.bind(me)
                    },
                    items: [
    
    
                        {
                            xtype: 'label',
                            cls: 'layermenulabel',
                            html: i18n.t('general.baselayers')
                        },
                        {
                            xtype: 'dataview',
                            emptyText: "Ei pohjakarttoja",
                            height: '100%',
                            listeners: {
                                itemsingletap: me.onLayerItemSingleTap
                            },
                            store: {
                                storeId: "storeBaselayers",
                                fields: ['label', 'name', 'img', 'checked'],
                                data: baselayersMenu
                            },
                            itemTpl: template
                        },
                        {
                            xtype: 'label',
                            cls: 'layermenulabel',
                            html: i18n.t('general.userlayers')
                        },
                        {
                            xtype: 'dataview',
                            minHeight: '50px',
                            height: '100%',
                            listeners: {
                                itemsingletap: me.onLayerItemSingleTap
                            },
                            emptyText: "Ei sisältöä",
                            store: {
                                storeId: "storeUserlayers",
                                fields: ['label', 'name', 'img', 'checked'],
                                data: userlayersMenu
                            },
                            itemTpl: template
                        },
                        {
                            xtype: 'label',
                            cls: 'layermenulabel',
                            html: i18n.t('general.overlaylayers')
                        },
    
    
                        {
                            xtype: 'dataview',
                            height: '100%',
                            emptyText: "Ei päälyskarttoja",
                            listeners: {
                                itemsingletap: me.onLayerItemSingleTap
                            },
                            store: {
                                storeId: "storeOverlaylayers",
                                fields: ['label', 'name', 'img', 'checked'],
                                data: overlaylayersMenu
                            },
                            itemTpl: template
                        }
                    ]
                });
    
    
    
    
                Ext.Viewport.setMenu(me.menu, {
                    side: 'right',
                    cover: true
                });
            }
    
    
            Ext.Viewport.showMenu('right');

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2014
    Location
    Finland
    Posts
    19
    Answers
    2

    Default

    Here is a screen recording from the issue. You can see that the menu can be scrolled, but only from the Label items (blue titles).

    https://youtu.be/EJwuhM9tWvU

Similar Threads

  1. two dataviews one json
    By erik_luengen in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 17 May 2013, 5:30 AM
  2. Dataviews misconception
    By anarchos78 in forum Ext: Q&A
    Replies: 4
    Last Post: 18 Apr 2012, 8:50 AM
  3. Can I have two DataViews on the same panel?
    By rwbaker in forum Sencha Touch 2.x: Q&A
    Replies: 5
    Last Post: 8 Feb 2012, 5:09 AM
  4. Problems with two dataviews
    By manuito in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 11 Feb 2010, 6:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •