[CLOSED] DateField replacing the "today" link with a different title and different date

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] DateField replacing the "today" link with a different title and different date

    Is there a way to either replace the "today" link with a different date and title, such as "Inception" and a custom date (date other than current day)? In addition can I add a custom link button, so you'd have "today" and "Inception" linking to two different dates.

    Thanks,
    Robb
    Last edited by Daniil; Dec 16, 2011 at 6:38 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please clarify do you mean the "month + year + arrow down" at the top of DatePicker?
  3. #3
    They link/button at the bottom of the control with label "Today". See attached image.
    Attached Thumbnails Click image for larger version. 

Name:	datefielde.JPG 
Views:	145 
Size:	18.5 KB 
ID:	3567  
  4. #4
    Quote Originally Posted by rmelancon View Post
    They link/button at the bottom of the control with label "Today". See attached image.
    You can set the .TodayText property of the DatePicker.
    Last edited by geoffrey.mcgill; Dec 12, 2011 at 6:33 PM.
    Geoffrey McGill
    Founder
  5. #5
    I understand the .TodayText will change the text but it will still fill in today's date when clicked. What I need is (for example) to change the text to "Tomorrow" and when clicked it will fill in tomorrows date.
  6. #6
    I can suggest the following solution.

    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:DateField runat="server" TodayText="Tomorrow">
                <Listeners>
                    <BeforeRender Handler="this.onTriggerClick = this.onTriggerClick.createSequence(function () {
                                                if (!this.wasTriggerClick) {
                                                    var btn = this.menu.picker.todayBtn;
                                                    btn.handler = function () {
                                                        this.setValue(new Date().add(Date.DAY, 1).clearTime());
                                                        this.fireEvent('select', this, this.value);
                                                    }
                                                    this.wasTriggerClick = true;
                                                }
                                           });" />
                </Listeners>
            </ext:DateField>
        </form>
    </body>
    </html>

Similar Threads

  1. [CLOSED] Is there any way to "disable" the FieldSet title label?
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 31, 2012, 8:47 PM
  2. [CLOSED] Default date format for Type="Date" RecordField
    By r_honey in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: May 29, 2012, 3:16 PM
  3. Replies: 4
    Last Post: May 22, 2012, 10:40 AM
  4. Replies: 0
    Last Post: Nov 07, 2011, 6:53 PM
  5. Replies: 1
    Last Post: Jul 11, 2011, 7:03 PM

Posting Permissions