[CLOSED] datepicker from to example

  1. #1

    [CLOSED] datepicker from to example

    hi,

    i have 2 date pickers on my page. I want to setup a 'from to range' example similar to the datefield example (http://examples1.ext.net/Examples/Fo...From-To_Range/). Can anyone help?

    Cheers

    Lee
  2. #2

    RE: [CLOSED] datepicker from to example

    Hi Lee

    I don't know if this is what you are looking for

    
    
    
    
    <ext:DateField 
    
    
    FieldLabel="From Date" Width="160" Format="dd/MM/yyyy" EmptyText="Enter/Select from Date -->"
    
    
    BlankText="From Date is required" MinDate="" runat="server" ID="txtFrom" Vtype="daterange">
    
    
    
    
    
    <Listeners>
    
    
    <Render Handler="this.endDateField = '#{txtTo}'" />
    
    
    </Listeners>
    
    
    </ext:DateField>
    
    
    <<ext:DateField FieldLabel="To Date"  Width="160" Format="dd/MM/yyyy" EmptyText="Enter/Select to Date -->"
    
    
    BlankText="To Date is required" MinDate="" runat="server" ID="txtTo" Vtype="daterange">
    
    
    
    
    
    <Listeners>
    
    
    <Render Handler="this.startDateField = '#{txtFrom}'" />
    
    
    </Listeners>
    
    
    </ext:DateField>
    Hope it helps
    Richardt
  3. #3

    RE: [CLOSED] datepicker from to example

    Hi,

    Thanks for the help richard. Unfortunately this doesn't help me. I want to use 2 datepicker controls rather than 2 datefield controls.

    Lee
  4. #4

    RE: [CLOSED] datepicker from to example

    Hi,

    Try the following
    <%@ 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">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        
        <script type="text/javascript">
            function setRange (date, isStart, picker) {
                if (isStart) {
                    picker.maxDate = date;
                } else {
                    picker.minDate = date;
                }
                
                var ad = picker.activeDate;                
                if (ad) {
                    picker.activeDate = null;
                    picker.update(ad);
                }
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager runat="server">
            </ext:ScriptManager>
            
            <ext:DatePicker ID="DatePicker1" runat="server">
                <Listeners>
                    <Select Handler="setRange(date, false, #{DatePicker2})" />
                </Listeners>
            </ext:DatePicker>
            <ext:DatePicker ID="DatePicker2" runat="server">
                <Listeners>
                    <Select Handler="setRange(date, true, #{DatePicker1})" />
                </Listeners>
            </ext:DatePicker>
        </form>
    </body>
    </html>
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. [CLOSED] DatePicker day highlighted
    By methode in forum 1.x Premium Help
    Replies: 3
    Last Post: Jan 13, 2012, 10:32 AM
  2. [CLOSED] DatePicker:
    By RomualdAwessou in forum 1.x Premium Help
    Replies: 8
    Last Post: Jul 09, 2010, 2:50 PM
  3. [CLOSED] DatePicker: drop
    By RomualdAwessou in forum 1.x Premium Help
    Replies: 4
    Last Post: Jun 28, 2010, 7:27 PM
  4. [CLOSED] DatePicker
    By Timothy in forum 1.x 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

Posting Permissions