Expand my Community achievements bar.

SOLVED

Datetime field listener

Avatar

Level 2

Hi all,

I am trying to implement a listener on a dialog field with xtype datetime for the change event.

The usecase is: To set the end date (value same as start date) once a start date has been selected by the user in the dialog. Start date and End dates are siblings.

I have implemented the following function on the listener node created under enddate field in dialog-

function()
{
var minDate = new Date();
var endDate =  this.previousSibling();
minDate=endDate;
minDate.setDate(minDate.getDate());
this.df.minValue=minDate;
}

The function doesnt work as expected.

Am i missing something here? Please help....

1 Accepted Solution

Avatar

Correct answer by
Level 10

Have you implemented at beforerender listener or other listener?
   Have a debug statement and see where it is failing.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Have you implemented at beforerender listener or other listener?
   Have a debug statement and see where it is failing.