Results 1 to 5 of 5

Thread: Docking issues with panels

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    32
    Answers
    3
    Vote Rating
    1
      0  

    Question Answered: Docking issues with panels

    Hello,

    I've made this code, but I can't get the bottom panel to show. I'm working at it now for a few days, but I can't figure it out.

    Code:
    Ext.setup({
        tabletStartupScreen: 'images/Norma/MI-logo-transparant.png',
        phoneStartupScreen: 'images/Norma/MI-logo-transparant.png',
        icon: 'images/Norma/Norma.png',
        glossOnIcon: false,
        name: 'normamobile',
    
        onReady: function () {
            var app = this;
    
            // construct UI
            var viewport = Ext.create('Ext.Panel', {
                fullscreen: true,
                layout: 'fit',
                showingPage: false,
                showingSplash: true
            });
    
            // the toolbar across the top of the app, containing the buttons
            var topBar = Ext.create('Ext.TitleBar', {
                ui: 'dark',
                height: 92,
                docked: 'top',
                title: 'Norma Mobile'
            });
    
            // creates the top banner with patient info
            var topbarPanel = Ext.create('Ext.Panel', {
                height: 92,
                docked: 'top',
                items: [topBar]
            });
    
            var bottomBar = Ext.create('Ext.TitleBar', {
                ui: 'dark',
                height: 46,
                docked: 'bottom',
                title: 'Bottom Bar'
            });
    
            var bottomPanel = Ext.create('Ext.Panel', {
                docked: 'bottom',
                height: 46,
                items: [bottomBar]
            });
    
            // the page that displays each chapter and holds the carousel
            var page = Ext.create('Ext.Panel', {
                cls: 'page',
                ui: 'dark',
                layout: {
                    type: 'fit'
                },
                items: [topbarPanel, bottomPanel]
            });
    
            //stitch the UI together and create an entry page
            viewport.add(page);
         }
    });
    Thank you.

  2. It looks like your over nesting may be valid, if this is only the basics of your UI (which I assume it is).

    Anyhow, it looks like you are not including a DOCTYPE in your index.html file. Simply add the following code at the top of index.html:

    Code:
    <!doctype html>
    And it'll work.

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    Just looking at your code and it seems you are overnesting and not using layouts on some classes that you should be. You can check the DOM to see if something is rendered but has heigh tof 0px to confirm that you need to use a layout or set a height. height will not always just work.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364
    Answers
    102
    Vote Rating
    87
      0  

    Default

    Please look at how types are used in the framework. They will ultimately help you reduce code weight.

  5. #4
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,159
    Answers
    93
    Vote Rating
    7
      0  

    Default

    It looks like your over nesting may be valid, if this is only the basics of your UI (which I assume it is).

    Anyhow, it looks like you are not including a DOCTYPE in your index.html file. Simply add the following code at the top of index.html:

    Code:
    <!doctype html>
    And it'll work.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  6. #5
    Sencha User
    Join Date
    Dec 2011
    Posts
    32
    Answers
    3
    Vote Rating
    1
      0  

    Thumbs up

    @ rdougan, indeed I misted the 'html' part sorry for bothering you guys.
    Thank you for all the help.

Posting Permissions

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