Results 1 to 4 of 4

Thread: Ext.navigation.View navigationBar long title wrong alignment in Sencha Touch 2.1

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    14
    Vote Rating
    2
      0  

    Default Ext.navigation.View navigationBar long title wrong alignment in Sencha Touch 2.1

    Hi.

    When there is no additional buttons added to navigationBar of navigationView - everything is working well. I also works well if title is short. But when title is cut - there are problems with alignment and title behaves unexpectable. See screenshots:

    iOS Simulator Screen shot Jan 22, 2013 11.01.39 AM.pngiOS Simulator Screen shot Jan 22, 2013 11.01.32 AM.pngiOS Simulator Screen shot Jan 22, 2013 11.01.24 AM.png


    Here is the code on my NavigationView:

    Code:
    Ext.define("iCoordinator.view.time.Nav", {
        extend: 'Ext.navigation.View',
        xtype: 'timenavigationview',
    
    
        config: {
            autoDestory: true,
            navigationBar: {
                ui: 'default'
            }
        },
    
    
        initialize: function () {
            var me = this;
    
    
            var nextIntervalBtn = Ext.create('Ext.Button', {
                itemId: "nextIntervalBtn",
                iconMask: true,
                iconCls: 'arrow_right',
                align: 'right',
                handler: this.onNextIntervalBtnClick,
                scope: this
            });
    
    
            var previousIntervalBtn = Ext.create('Ext.Button', {
                itemId: "previousIntervalBtn",
                iconMask: true,
                iconCls: 'arrow_left',
                align: 'left',
                handler: this.onPreviousIntervalBtnClick,
                scope: this
            });
    
    
            this.getNavigationBar().add([nextIntervalBtn, previousIntervalBtn]);
    
    
            me.getNextIntervalBtn = function() {
                return nextIntervalBtn;
            }
    
    
            me.getPreviousInteralBtn = function() {
                return previousIntervalBtn;
            }
    
    
            this.callParent(arguments);
        },
    
    
        setTitle: function(title) {
            this.getNavigationBar().setTitle(title);
        },
    
    
        onPreviousIntervalBtnClick: function() {
            this.fireEvent('previousIntervalCommand', this);
        },
    
    
        onNextIntervalBtnClick: function() {
            this.fireEvent('nextIntervalCommand', this);
        }
    });
    Actually, title looks good only when navigationView is first initialized. After pushing/popping views you can see on screenshots, what happens.

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,029
    Vote Rating
    1368
      0  

    Default

    With your provided test case, I don't see anything wrong.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    14
    Vote Rating
    2
      0  

    Default

    You are right, when navigationView is used separately (I tried it myself) - everything works well. But my bug appears if I put this navigationView inside other Container. I my case it is this container:

    Code:
    Ext.define("iCoordinator.view.time.Main", {
        extend: 'Ext.Container',
        xtype: 'timemainview',
    
    
        config: {
            layout: 'fit'
        },
    
    
        initialize: function () {
            var me = this;
            this.callParent(arguments);
    
    
            var timeNavigationView = {
                xtype: 'timenavigationview'
            }
    
    
            this.add([timeNavigationView]);
        }
    });

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    14
    Vote Rating
    2
      0  

    Default

    You can use this controller as an example:

    Code:
    Ext.define('iCoordinator.controller.TimeController', {
        extend: 'Ext.app.Controller',
    
    
        config: {
            views: [
                'iCoordinator.view.time.Nav',
                'iCoordinator.view.time.Main'
            ],
            refs: {
                timeNavigationView: 'timenavigationview'
            },
    
    
            control: {
                timeNavigationView: {
                    nextIntervalCommand: 'onNextIntervalCommand'
                }
            }
        },
    
    
        onNextIntervalCommand: function() {
            var me = this;
    
    
            me.getTimeNavigationView().push({
               title: 'Very long title goes here lalala',
               html: "Text content"
            });
        }
    
    
    });

Posting Permissions

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