How do I use the DatePicker control?

  1. #1

    How do I use the DatePicker control?

    I trying use a DatePicker control...

    My question is:

    What event is triggered (DirectEvent) when I click the arrows to move forward and backward month, in the title of the DatePicker...

    Thanks for any help.
  2. #2
    Hi,

    Events are not fired for Next/Previous month scrolling. More documentation for the DatePicker is available at the following location, see

    http://docs.sencha.com/ext-js/3-4/#!...r-event-select
    Geoffrey McGill
    Founder
  3. #3
    Thanks Geoffrey...

    I need to close these threads when my doubts are cleared up? how do I do?
  4. #4
    Hi,

    Please don't worry about a thread apart from the following things:

    1. Starts a thread in a correct forum, for example:

    - A technical support question related to Ext.NET v1 on the 1.x Help forum or on the 1.x Premium Help if you are a premium member.
    - A technical support question related to Ext.NET v2 on the 2.x Help forum or on the 2.x Premium Help if you are a premium member.
    - Some discussion on the Open Discussions forum.
    - etc.

    2. Keep one issue per one thread.

    The rest things we make ourselves.

    Regarding to your question.

    Commonly, we recommend to use Ext.NET/ExtJS API things, but since you are a new in Ext.NET/ExtJS, I should demonstrate how they are flexible to override/extend.

    Please run the example and try to change a month by clicking on the arrows buttons or pressing "CTRL + <--" and 'CTRL + -->" keys combination.

    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>
    
        <ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />
    
        <script type="text/javascript">
            Ext.DatePicker.prototype.initComponent = Ext.DatePicker.prototype.initComponent.createSequence(function () {
                this.addEvents("prevmonth", "nextmonth");
            });
    
            Ext.DatePicker.prototype.showPrevMonth = Ext.DatePicker.prototype.showPrevMonth.createSequence(function () {
                this.fireEvent("prevmonth");
            });
    
            Ext.DatePicker.prototype.showNextMonth = Ext.DatePicker.prototype.showNextMonth.createSequence(function () {
                this.fireEvent("nextmonth");
            });
        </script>
        <script type="text/javascript">
            var onRender = function () {
                this.on("prevmonth", onPrevMonth);
                this.on("nextmonth", onNextMonth);
            };
    
            var onPrevMonth = function () {
                DisplayField1.append("PREV, activeDate is " + this.activeDate.format("Y-m-d") + "<br/>");    
            };
    
            var onNextMonth = function () {
                DisplayField1.append("NEXT activeDate is " + this.activeDate.format("Y-m-d") + "<br/>");
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:DatePicker runat="server">
                <Listeners>
                    <Render Fn="onRender" />
                </Listeners>
            </ext:DatePicker>
            <ext:DisplayField ID="DisplayField1" runat="server" />
        </form>
    </body>
    </html>
  5. #5
    Thanks a lot, Daniil for your clarification...

    The exemple of DatePicker works fine. thank you once again...

    Best regards

Similar Threads

  1. DatePicker Day Highlighted
    By gefferson.librelato in forum 1.x Help
    Replies: 5
    Last Post: Jan 27, 2012, 1:16 PM
  2. DatePicker in a tab
    By echo in forum 1.x Help
    Replies: 8
    Last Post: Jan 22, 2009, 9:10 AM
  3. DatePicker customization
    By methode in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 29, 2008, 6:28 PM
  4. [FIXED] [V0.7.0] Bug with DatePicker
    By Jurke in forum Bugs
    Replies: 5
    Last Post: Oct 05, 2008, 11:00 AM
  5. Datepicker From/To
    By srinag315 in forum 1.x Help
    Replies: 0
    Last Post: Apr 10, 2008, 10:23 PM

Tags for this Thread

Posting Permissions