Sunday, March 11, 2012

tabcontainer+tabpanels: wrapping?

Hi,

Please note that in addition to the css style you defined, a default style that specifies white-space to nowrap will be appended. This default style is the last one to be appended and will override yours. Here is the relevant code:

initialize : function() {
AjaxControlToolkit.TabContainer.callBaseMethod(this, "initialize");

var elt = this.get_element();
var header = this._header = $get(this.get_id() + "_header");
var body = this._body = $get(this.get_id() + "_body");

// default classes
$common.addCssClasses(elt, [
"ajax__tab_container",
"ajax__tab_default"
]);
Sys.UI.DomElement.addCssClass(header, "ajax__tab_header");
Sys.UI.DomElement.addCssClass(body, "ajax__tab_body");

this._invalidate();

Sys.Application.add_load(this._app_onload$delegate);
},

.ajax__tab_default .ajax__tab_header {white-space:nowrap;}

You can try to use similar code to remove this style.


In my current project I opted for a dropdownlist instead, but this could/will be usefull in the future.

The code you provided: is it intended to replace anything in the toolkit that would require me to rebuild it or is it some function I can run directly in the page with tabs? (I never took time to seriously look at the code in the toolkit, I just use the few controls I need sometimes, mainly the tabs)


I have just studied AjaxControltoolkit and TabContainer recently,I also have this problem, so can you tell me clearly the way to fix this problem? I downloaded ajaxControltoolkit without source.

1.Must I add class .Tabs.ajax_tab_header { white_space:pre_wrap;} in css file of my website? But when I just do this,and in aspx file I set CssClass of TabContainer is ".Tabs.ajax_tab_header" TabContainer have not format default. Maybe,tabcontainer don't use default styte?

2.Where I can add your code in my source? It seem to be javascript? I add them in tag <script> in aspx file but this problem don't fix.

Please help me!

No comments:

Post a Comment