I've been attempting to modify the "change" event of a Kendo UI Dropdownlist without success. Here is the code I have tested:
Below is the initialization code for my dropdownlist:
var onChange = function(e)
{
alert("something changed");
};
// Initializing DropDownList from input HTML element
$("#dropdown").kendoDropDownList({
dataTextField: "text",
dataValueField: "value",
dataSource: data,
index: 0,
change: onChange
});
Here is my attempt to update that function later on:
onChange = function(e){alert("attempt 1");};
var dropDownData = $("#dropdown").data("kendoDropDownList");
dropDownData.options.change = function(e){alert("attempt 2");}
dropDownData.refresh();
In my first attempt, I tried changing the onChange function directly. When that didn't work, I attempted to edit the options.change function. Although I successfully modified the options.change function in the Chrome debugger, the functionality of the dropdownlist remained the same. It seems like I need to refresh the dropdownlist to apply my changes effectively. Can someone advise me on how to refresh the kendo grid and display my updated data?