DateRangePicker keep calendar open

Hello

I am using ASP.NET CORE EJ 2 version 16.1.0.37 (nuget package).

How can I prevent the DateRangePicker from closing?

For the normal DatePicker this works:

function onDatePickerClose(args) {
        args.preventDefault();
}

However, when doing this for DateRangePicker, "args" does not have a "preventDefault()" method.


Kind regards
Phil

7 Replies

PK Prem Kumar Madhan Raj Syncfusion Team June 7, 2018 02:13 PM UTC

Hi Phil, 

Sorry for the inconvenience. 

This is a known issue at our end and this issue has been fixed internally. Also, the fix for this issue will be included in our Volume 2 2018 release which is to be release by mid of June 2018. We appreciate your patience until then. 

Regards, 

Prem Kumar M 



UN Unknown June 8, 2018 05:34 AM UTC

I see.
Thank you a lot for your reply.


PK Prem Kumar Madhan Raj Syncfusion Team June 11, 2018 06:51 AM UTC

Hi Phil, 

Most welcome. Please let us know if you need further assistance. 

Regards, 

Prem Kumar M 



UN Unknown July 9, 2018 12:27 PM UTC

Hello

Now the Volume 2 2018 release is out but the exception still occurs.

function onDatePickerClose(args) {
        args.preventDefault();
}

This code still throws an exception. The preventDefault() function does still not exist.
Was this not fixed in the new release?



PK Prem Kumar Madhan Raj Syncfusion Team July 10, 2018 02:53 PM UTC

Hi Phil, 

Sorry for the inconvenience. 

No, this issue was fixed with our Volume 2 2018 release. You can achieve this by assigning args.cancel value as true in the close event as shown in the below code snippet. In order to make the event arguments common for all EJ2 input components, we have used args.cancel instead of preventDefault() method to restrict the popup close in our components. Also, in DatePicker, preventDefalut() method will be deprecated in any of our upcoming releases.So, we suggest you to go with args.cancel to restrict the popup close as it will be common with all our input components. 

<script> 
    function onClose(args) { 
        args.cancel = true; 
    } 
</script> 

Note: This is common for all the calendar components. 

Regards, 

Prem Kumar M


UN Unknown July 11, 2018 06:27 AM UTC

Everything works as you described.
Thank you a lot for these useful information. I changed all my usages of args.preventDefault(); to args.cancel = true;.


PK Prem Kumar Madhan Raj Syncfusion Team July 12, 2018 07:14 AM UTC

Hi Phil, 

We are glad to know that issue has been resolved at your end. Please let us know if you need further assistance. 

Regards, 

Prem Kumar M 


Loader.
Up arrow icon