Sencha Touch 1.x TabPanel to the left Tabbar

Source: Internet
Author: User

First look at the effect

Actually, it's going to hit a problem.

Sencha Touch, the Tabbar can only be displayed if it is set above or below.

If you set it to the left, the default is to produce the result:

To solve this problem, my first reaction is to use CSS. But that undoubtedly adds to the complexity. (I did, too, and it was a terrible problem.)

In fact, as long as the layout of Sencha touch cooked a little, analysis, it is easy to find the key to the problem.

Level a row over the Tab1,tab2,tab3 button, what is this? This is not the Hbox layout!

OK, which means to make it vertical, just change the Hbox layout to VBox layout.

The first of these measures

Because TAB1,TAB2,TAB3 is inside the Tabbar, we changed the layout of Tabbar to VBox.

The code is as follows:

TabBar: {
' VBox ' ,
' Left '
}

Found no effect. Toss it out. Find the following wording to work:

TabBar: {
Layout: {
' VBox '
},
' Left '
}

Reason why ... Didn't understand.

In this way, the effect of the operation is as follows:

Beautifying and Perfecting

Close together, it's hard to see. So I tried to configure the margin. I tried to use CSS syntax to match the margin to make sense.

Surprise. You can configure margin for each direction individually.

TabBar: {
Layout: {
' VBox '
},
Defaults: {
' Ten 0 0 0 ' ,
},
' Left '
}

Thus, the final result was obtained. That's the way we saw it at the beginning.

The complete code is as follows:

Ext.setup ({
Onready:function() {
NewExt.tabpanel ({
Fullscreen:true,
Type:'Dark',
TabBar: {
Layout: {
Type:'VBox'
},
Defaults: {
Margin:'Ten 0 0 0',
},
Dock:' Left'
},
Sortable:true,
Items: [{
Title:'Tab 1',
HTML:'1',
CLS:'Card1'
}, {
Title:'Tab 2',
HTML:'2',
CLS:'Card2'
}, {
Title:'Tab 3',
HTML:'3',
CLS:'Card3'
}]
});
}
});

Sencha Touch 1.x TabPanel to the left Tabbar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.