Results 1 to 7 of 7

Thread: Date Field problem

  1. #1
    Sencha User mihaip007's Avatar
    Join Date
    Feb 2008
    Location
    Pretoria, South Africa
    Posts
    194
    Vote Rating
    -4
      0  

    Default Date Field problem

    Hi...!

    I just wanted to know if it is possible to place a default date when running the application for a date field. I mean I would like to show today's date already entered in the box.

    I tried to use "showToday" config option but it does nothing.

    Can someone suggest something on this?
    Thanks a million...

  2. #2
    Sencha User mihaip007's Avatar
    Join Date
    Feb 2008
    Location
    Pretoria, South Africa
    Posts
    194
    Vote Rating
    -4
      0  

    Default

    No One???

  3. #3
    Sencha User jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
      0  

    Default

    The "showToday" option is the correct configuration option you should use. We will make a note to visually update the field's contents when this is chosen in a future release. Thanks.

  4. #4
    Sencha User mihaip007's Avatar
    Join Date
    Feb 2008
    Location
    Pretoria, South Africa
    Posts
    194
    Vote Rating
    -4
      0  

    Default

    Hi...! Thank you for the reply So I take it that it does not work yet.

    But how can I make it work in the meanwhile? I am not talking about Previewing, but about when exporting.
    Thanks...
    Mihai

  5. #5
    Sencha User jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
      0  

    Default

    Sorry, I misunderstood. Setting the field to be a default value that is dynamic can be done in your implementation .js file within the initComponent function, so it will show in the text field. The "showToday" option is to turn on/off the Today button that appears at the bottom of the calendar pop-up.

    e.g.:

    Exported Form UI File .ui.js
    Code:
    MyFormUi = Ext.extend(Ext.form.FormPanel, {
        title: 'My Form',
        labelWidth: 100,
        labelAlign: 'left',
        layout: 'form',
        width: 400,
        height: 250,
        padding: 10,
        initComponent: function() {
            this.items = [
                {
                    ref: 'date',
                    xtype: 'datefield',
                    fieldLabel: 'Label',
                    anchor: '100%',
                    showToday: false
                }
            ];
            MyFormUi.superclass.initComponent.call(this);
        }
    });
    Exported Form Implementation File .js
    Code:
    MyForm = Ext.extend(MyFormUi, {
        initComponent: function() {
            MyForm.superclass.initComponent.call(this);
            
            this.date.setValue(new Date().format('m-d-Y'));
        }
    });

  6. #6
    Sencha User mihaip007's Avatar
    Join Date
    Feb 2008
    Location
    Pretoria, South Africa
    Posts
    194
    Vote Rating
    -4
      0  

    Default

    oh...cool! Sorry I just realized I need to brush up on my help file reading hehehehe! You know, perhaps having a hint pop-up over the config options in the designer would be an idea!

    Mihai

  7. #7
    Sencha User jarrednicholls's Avatar
    Join Date
    Mar 2007
    Location
    Frederick, MD
    Posts
    1,747
    Vote Rating
    7
      0  

    Default

    Context sensitive help (links to documentation) is coming in a near future release. We agree! :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •