May 30, 2012, 6:52 PM
[CLOSED] Using TabStrip, creating tab dynamically from codebehind, but NO LISTENERS on the 'TabStripItem'
Hi,
When changing Tab the Notify Box is ALWAYS "Line 4"
What result is needed:
I need when I change the 'TabStripItem' the Notify Message should display each line as per their Tab.
I notice there is NO LISTENERS on the 'TabStripItem'
How would I get this result with TabStrip while creating it dynamically ??
When changing Tab the Notify Box is ALWAYS "Line 4"
What result is needed:
I need when I change the 'TabStripItem' the Notify Message should display each line as per their Tab.
I notice there is NO LISTENERS on the 'TabStripItem'
How would I get this result with TabStrip while creating it dynamically ??
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ 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" };
for (int i = 1; i <= lines.Count; i += 1)
{
//* NEW TabStripItem */
var tabStripItem = new TabStripItem
{
Title = lines[i - 1]
};
TabStrip1.Listeners.TabChange.Handler = "Ext.net.DirectMethods.LoadActiveTab('" + lines[i - 1] + "');";
TabStrip1.Items.Add(tabStripItem);
}
}
}
[DirectMethod]
public void LoadActiveTab(string tabName)
{
//X.Msg.Notify("The Server Time is: ", DateTime.Now.ToLongTimeString()).Show();
X.Msg.Notify("Server Side, Tab clicked: ", tabName).Show();
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Ext.NET Example</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:TabStrip ID="TabStrip1" runat="server" />
</form>
</body>
</html>
Last edited by Daniil; May 30, 2012 at 8:57 PM.
Reason: [CLOSED]