[CLOSED] datepicker event

  1. #1

    [CLOSED] datepicker event

    What is event name for month changes in date picker? I want to do something when a user change the month. Thx
    Last edited by Daniil; Sep 01, 2010 at 9:56 AM. Reason: [CLOSED]
  2. #2
    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
    <%@ 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>
  3. #3
    Hii Daniil, It works great. But i stiil have a question how to fire direct method instead of javascript function?
  4. #4
    Hi,

    Also the following plugin could be interested for you
    <ext:MonthPicker runat="server"/>
    Just add it to the Plugins section of the DatePicker
    Vladimir Shcheglov
    Sr. Developer
  5. #5
    Pls how to get current Month (js is ok), something like #{DatePicker}.currentMonth
  6. #6
    Hello!

    Please use the getValue method.

    getValue() : DateGets the current selected value of the date fieldParameters:
    • None.

    Returns:
    • DateThe selected date



  7. #7
    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
  8. #8
    Please look at the example.

    Example
    <%@ 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>

Similar Threads

  1. [CLOSED] DatePicker and AjaxControlToolkit
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Dec 17, 2019, 8:02 PM
  2. [CLOSED] DatePicker:
    By RomualdAwessou in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jul 09, 2010, 2:50 PM
  3. [CLOSED] datepicker from to example
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Apr 04, 2010, 2:29 PM
  4. [CLOSED] DatePicker
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 18, 2008, 4:31 AM
  5. [CLOSED] Datepicker help
    By Jurke in forum 1.x Help
    Replies: 13
    Last Post: Sep 22, 2008, 6:52 AM

Tags for this Thread

Posting Permissions