1

When I use DateField.getValue(),

(this.toDate.getValue()=="" && this.toDate.getValue()=="")

I get this error message:

Error Msg : DateField.getValue() is not a function

following code:

function(){
    if(!(this.toDate.getValue()=="" && this.toDate.getValue()==""))
      {
        if(this.frmDate.getValue()>this.toDate.getValue()){
            msgBoxShow(160,1);
            this.frmDate.setValue("");
            return;
        } else {
            //calc duration
         var frm = this.frmDate.getValue().format(Wtf.simplifyDateFormat());
                     var to = this.toDate.getValue().format(Wtf.simplifyDateFormat());
            if((frm!=""&&to!="")){

                                  this.expensesds.load({
                    params:{
                        frmDate:frm,
                        toDate:to,
                        start:0                         

                    },
                    scope: this,
                    callback: function(rec, opt, succ){
                        if(succ){
                            this.expensesds.groupBy("viewby");
                        }
                    }
                });
                this.expensesds.groupBy("viewby");
            }
            else return;
        }
    } else {
        return;
    }
},
GameDroids
  • 5,584
  • 6
  • 40
  • 59
Bipil Raut
  • 244
  • 1
  • 10

2 Answers2

0
this.toDate = new Wtf.form.DateField({
        emptyText:WtfGlobal.getLocaleText("ec.Todate") + "...",
        readOnly:true,
        width : 150,
        value:new Date(),
        format:Wtf.getDateFormat(),
        name : 'todate'
    });

this issue not create if you assign toDate field inside on render or global declaration

Bipil Raut
  • 244
  • 1
  • 10
  • onRender:function(config) { Wtf.tm.reports.ExpenseTypeReport.superclass.onRender.call(this,config); this.createReportGrid(); this.add(this.grid1); this.toDate = new Wtf.form.DateField({ emptyText:WtfGlobal.getLocaleText("ec.Todate") + "...", readOnly:true, width : 150, value:new Date(), format:Wtf.getDateFormat(), name : 'todate' }); – Bipil Raut Dec 25 '14 at 09:26
0

In some cases you can use the ".text()" instead of ".getValue()"...

Alex
  • 1,297
  • 1
  • 16
  • 12