What is event name for month changes in date picker? I want to do something when a user change the month. Thx
Printable View
What is event name for month changes in date picker? I want to do something when a user change the month. Thx
Hello!
There is no such events. But you could achieve these requirements using createSequence, createInceptor or createCallback methods.
I think this link can be useful for you.
Example
Code:<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!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 runat="server">
<title>Ext.Net Example</title>
<script type="text/javascript">
var yourFunction = function() {
Ext.Msg.alert("",'Hello! A month is changed.');
}
var yourFunction2 = function(e, t) {
var el = new Ext.Element(t);
if (el.is('button.x-date-mp-ok')) {
Ext.Msg.alert("", "Hello! Clicked Ok button")
}
}
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" ScriptMode="Debug"/>
<ext:DatePicker runat="server">
<Listeners>
<BeforeRender Handler=" this.showPrevMonth = this.showPrevMonth.createSequence(yourFunction);
this.showNextMonth = this.showNextMonth.createSequence(yourFunction);
this.onMonthClick = this.onMonthClick.createSequence(yourFunction2);" />
</Listeners>
</ext:DatePicker>
</form>
</body>
</html>
Hii Daniil, It works great. But i stiil have a question how to fire direct method instead of javascript function?
Hi,
Also the following plugin could be interested for you
Just add it to the Plugins section of the DatePickerCode:<ext:MonthPicker runat="server"/>
Pls how to get current Month (js is ok), something like #{DatePicker}.currentMonth
Hello!
Please use the getValue method.
Quote:
getValue() : DateGets the current selected value of the date fieldParameters:
- None.
Returns:
- DateThe selected date
Hii daniil,
Does it possible to get the month displayed on the DatePicker, not the month from selected date? I believe getValue return data from selected date. thx
Please look at the example.
Example
Code:<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!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 runat="server">
<title>Ext.Net Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:DatePicker ID="DatePicker1" runat="server"/>
<ext:Button runat="server" Text="Get month name">
<Listeners>
<Click Handler="Ext.Msg.alert('', DatePicker1.mbtn.text)"/>
</Listeners>
</ext:Button>
</form>
</body>
</html>