[CLOSED] Bug in Date Range Example

  1. #1

    [CLOSED] Bug in Date Range Example

    Hello my fellow members.

    I am new to ext.net, and are working with ext.net at work and i must say i am very pleased with this framework, very smooth and nice to implement.

    On Topic.

    Ind the exsample From - To - Range

    it appers there is a bug or code error in this section..

    
      var onKeyUp = function (field) {
                var v = this.getRawValue(),
                    field;
    
                if (this.startDateField) {
                    field = Ext.getCmp(this.startDateField);
                    field.setMaxValue();
                    this.dateRangeMax = null;
                } else if (this.endDateField) {
                    field = Ext.getCmp(this.endDateField);
                    field.setMinValue();
                    this.dateRangeMin = null;
                }
    
                field.validate();
            };
    I have found out that in order to have this code ristrict the date between the chosen dates, you have to set the listener on blur insted of keyUp event,
    if it has to work as intendet in the exsample.
    You also need to put "v" as a argument in the methods setMaxValue and setMinValue in order for the invalide dates to be grayed out.

    like so:

    
      var onKeyUp = function (field) {
                var v = this.getRawValue(),
                    field;
    
                if (this.startDateField) {
                    field = Ext.getCmp(this.startDateField);
                    field.setMaxValue(v);
                    this.dateRangeMax = null;
                } else if (this.endDateField) {
                    field = Ext.getCmp(this.endDateField);
                    field.setMinValue(v);
                    this.dateRangeMin = null;
                }
    
                field.validate();
            };
    Dont know if it is me who is wrong or its a bug...?

    Hope this help.

    Bedst regards

    Akpenob..
    Last edited by Daniil; Nov 08, 2012 at 9:14 AM. Reason: [CLOSED]
  2. #2
    Hi @Akpenob,

    Thank you for the report.

    Please try this.

    var onKeyUp = function () {
        var me = this,
            v = me.getValue(),
            field;
    
        if (me.startDateField) {
            field = Ext.getCmp(me.startDateField);
            field.setMaxValue(v);
            me.dateRangeMax = v;
        } else if (me.endDateField) {
            field = Ext.getCmp(me.endDateField);
            field.setMinValue(v);
            me.dateRangeMin = v;
        }
    
        field.validate();
    };
    If you will face any issues again, please report.

Similar Threads

  1. [CLOSED] Date range picker...
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 16, 2012, 12:55 PM
  2. [CLOSED] From to date range
    By Raynald_Fontaine in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 30, 2012, 9:52 AM
  3. [CLOSED] From-To Date Range
    By jeremyl in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 30, 2012, 9:52 AM
  4. [CLOSED] [1.2] Date Range Change
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 06, 2011, 4:53 PM
  5. Date Range in Gridpanel?
    By Tbaseflug in forum 1.x Help
    Replies: 1
    Last Post: Jan 29, 2009, 3:41 PM

Tags for this Thread

Posting Permissions