Completed
Last Updated: 08 Nov 2024 14:08 by ADMIN
Release 2024 Q4 (Nov)
oleg
Created on: 04 Oct 2024 12:57
Category: DateRangePicker
Type: Bug Report
1
Clear Button Does Not Trigger Change Event

Bug report

When clearing the contents of part of a Kendo UI DateRangePicker with a clear button, the change event does not trigger.

Reproduction of the problem

  1. Go to this Progress Kendo UI Dojo.
  2. Add dates to start and end inputs - Change event fires as shown in console.
  3. Clear them with the clearbutton - Change event does not fire.

Expected/desired behavior

The Change event should fire when clear button is pressed.

Workaround

Subscribing to a mousedown event on the clear button, and manually triggering the change event. It will require a setTimeout due to timing purposes:

      //Mousedown event on clear button
      $("span.k-clear-value").on("mousedown", function(e){

        //set timeout for timing purposes
        setTimeout(function(){

          //reference DateRangerPicker and trigger Change event
          var dateRange = $("#daterangepicker").data("kendoDateRangePicker");
          dateRange.trigger("change");
        }, 200);
      });

Environment

0 comments