Allow Editing

Editing in input box can be disabled by setting the false value to AllowEdit API. By default this property will be true and we can edit the value in input box.

  • cshtml
  • <ej-date-range-picker id="DateRange" width="35%" allow-edit=true></ej-date-range-picker>

    Enable/Disable

    The control can be enabled / disabled using public methods, enable or disable.

  • cshtml
  • <ej-date-range-picker id="DateRange" width="35%" create=Create></ej-date-range-picker>
    
        <script>
        //Create event triggers after DateRangePicker created successfully.
            function Create() {
                $("#DateRange").ejDateRangePicker('disable');
                } 
        </script>

    Clear Ranges

    To clear the all selection and ranges in a popup we can make use of clearRanges method.

  • cshtml
  • <ej-date-range-picker id="DateRange" width="35%" before-close=Clear></ej-date-range-picker>
    
        <script>
        //BeforeClose event triggers before closing DateRangePicker popup
        function Clear() {
                    $("#DateRange").ejDateRangePicker('clearRanges');
                }
    
        </script>

    The following screenshot displays the output for the above code.

    BeforeClose Event of DateRangePicker