Jun 21, 2012, 3:52 PM
[CLOSED] Creating TabStrip Items dynamically in Ext v2.0, but it does NOT render the style properly...
Hi,
I'm creating TabStrip Items dynamically but the style renders incorrectly ?
Have a look at my Dynamic TabStrip which is "TabStrip1" and the difference between the static TabStrip which is "TabStrip2"
I'm creating TabStrip Items dynamically but the style renders incorrectly ?
Have a look at my Dynamic TabStrip which is "TabStrip1" and the difference between the static TabStrip which is "TabStrip2"
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" TagPrefix="ext" Namespace="Ext.Net" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
var lines = new List<string>() { "Line 1", "Line 2", "Line 3", "Line 4" };
int i = 1;
foreach (var line in lines)
{
/* NEW Tab */
var tabStripItem = new Tab
{
TabID = i.ToString(),
Text = line,
ToolTip = line
};
TabStrip1.Listeners.TabChange.Handler = "App.direct.LoadActiveTab(tab.id, tab.text);";
TabStrip1.Items.Add(tabStripItem);
i++;
}
}
}
[DirectMethod]
public void LoadActiveTab(string id, string text)
{
var title = "ID #: " + id;
X.Msg.Notify(title, text).Show();
}
</script>
<html>
<head>
<title>Example of Issue </title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:TabStrip ID="TabStrip1" runat="server" />
<br />
<ext:TabStrip ID="TabStrip2" runat="server">
<Items>
<ext:Tab Text="Summary" ActionItemID="elm1" />
<ext:Tab Text="Data" ActionItemID="elm2" />
</Items>
</ext:TabStrip>
<div id="elm1" style="padding: 5px;">
Summary</div>
<div id="elm2" style="padding: 5px;">
Data</div>
</form>
</body>
</html>
Last edited by Daniil; Jun 22, 2012 at 2:47 PM.
Reason: [CLOSED]