Dec 05, 2008, 3:26 PM
[CLOSED] DateMenu in a SplitButton
Hello,
The following example illustrates a complication with the date picker in a SplitButton.
Example.aspx:
1. Load page
2. Select context menu
3. Select a Christmas from date picker
4. Notice AJAX Event updates lblResult with current date (12/05/2008)
5. Select context menu again
6. Select January 1st, 2009
7. Notice Christmas date is now displayed in lblResult
Any questions, please feel free to ask.
Cheers,
Timothy
The following example illustrates a complication with the date picker in a SplitButton.
Example.aspx:
<%@ Page Language="C#" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void btnShoppingCartReportCash_Select(object sender, AjaxEventArgs e)
{
lblResult.Text = dateShoppingCartReportCash.Picker.SelectedDate.ToString("g");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Example Page</title>
</head>
<body>
<form id="Form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" />
<ext:ScriptManager ID="ScriptManager2" runat="server" AjaxViewStateMode="Include" StateProvider="PostBack" Theme="Gray" />
<ext:SplitButton runat="server" Text="Testing">
<Menu>
<ExtJS:Menu>
<Items>
<ExtJS:MenuItem runat="server" Text="Cash Drawer" Icon="Calendar">
<Menu>
<ExtJS:DateMenu ID="dateShoppingCartReportCash" runat="server">
<AjaxEvents>
<Select OnEvent="btnShoppingCartReportCash_Select" />
</AjaxEvents>
</ExtJS:DateMenu>
</Menu>
</ExtJS:MenuItem>
</Items>
</ExtJS:Menu>
</Menu>
</ext:SplitButton>
<ext:Label ID="lblResult" runat="server" Text="Waiting ..." />
</form>
</body>
</html>
Replication steps:1. Load page
2. Select context menu
3. Select a Christmas from date picker
4. Notice AJAX Event updates lblResult with current date (12/05/2008)
5. Select context menu again
6. Select January 1st, 2009
7. Notice Christmas date is now displayed in lblResult
Any questions, please feel free to ask.
Cheers,
Timothy