Hi, I am trying to create a custom “Today” button in my calendar view.
The problem I have is that I don’t know how to reference the control itself from the “handler” function. The only input parameter is “event”, which in this case is of type “PointerEvent” and from it I can’t, or don’t know, how to get the instantiation of the control.
I have searched the documentation and forums and the closest thing is “activeInstance” but it doesn’t work. Here is an example of the code:
var opts = {
controls: ['calendar','time'],
dateFormat: 'D-MM-YYYY',
timeFormat: 'H:mm:ss',
returnFormat: 'iso8601'
stepMinute: 5,
stepSecond: 30,
buttons: [
{
text: 'OK',
cssClass: 'icon-folder-ope',
handler: 'set',
keyCode: 'enter'
},
'cancel',
{
text: _locale['nowText'],
handler: function (event):void {
//necesito saber la instáncia
var inst = mobiscroll.activeInstance;
inst.setVal(new Date());
inst.close();
},
keyCode: 'space'
}
]
};
mobiscroll.datepicker( jeweldatefield2, opts );
Thx.