Results 1 to 3 of 3

Thread: How to CSS customize a NavigationView navigationBar

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    65
    Answers
    7
    Vote Rating
    1
      0  

    Default Answered: How to CSS customize a NavigationView navigationBar

    Hi,

    I'm trying to customize the automaticly added top NavigationBar in a NavigationView, this should be the template:
    Screen Shot 2012-10-17 at 13.56.45.png

    So the title is left, and the back button has a total different style. When I would click a date, the title would change to this date.

    I can't style them using CSS only, there's just too many options to be disabled, and too many DIVs in DIVs.

    The list below the toolbar was easy to manage using baseCls and itemCls options from ST, but I can't find any similar ways for the navigationBar.

    Any ideas?

  2. For the back button you need to actually edit the back button config. Here is a simple test case:

    Code:
    Ext.Viewport.add({
        xtype         : 'navigationview',
        navigationBar : {
            backButton : {
                align : 'right' //moves it to the right
            },
            /**
             * Add a 2nd button on right side
             */
            items      : [
                {
                    text  : 'Finish',
                    align : 'right'
                }
            ]
        },
        items         : [
            {
                title : 'Home',
                html  : 'home'
            },
            {
                title : 'Another',
                html  : 'another'
            }
        ]
    });

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

    Default

    For the back button you need to actually edit the back button config. Here is a simple test case:

    Code:
    Ext.Viewport.add({
        xtype         : 'navigationview',
        navigationBar : {
            backButton : {
                align : 'right' //moves it to the right
            },
            /**
             * Add a 2nd button on right side
             */
            items      : [
                {
                    text  : 'Finish',
                    align : 'right'
                }
            ]
        },
        items         : [
            {
                title : 'Home',
                html  : 'home'
            },
            {
                title : 'Another',
                html  : 'another'
            }
        ]
    });
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

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

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    65
    Answers
    7
    Vote Rating
    1
      0  

    Default

    Hey, in the mean time I changed the Navigationview to a Container , this way I could fully customize the CSS.

    Unfortunately this meant I had to implement my own Push() and Pop() system.

    I don't think I could have changed the topbar fully to make it look like the picture in the OP, some CSS settings (like padding) were already set and were difficult to override, unless I would have added a ton of very context-sensitive CSS maybe.

    Maybe this component needs more CSS-selectors like other components?

    Thanks for the reply!

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
  •