Hello,
I'm trying to retrieve data from the kendoAutoComplete component, but I'm encountering an issue when the input is hidden.
The happy path works perfectly when the input is visible. For example:
<input id="test">
var data = ["One", "Two"];
$("#test1").kendoAutoComplete({
dataSource: data
});
$("#test1").data('kendoAutoComplete').dataSource.data() // return ["One", "Two"]
However, the problem arises when the input is not visible (e.g., using style="display: none;"). I use the same code, but when I call the data() method, it does not return the original data. Instead, it returns undefined until I make the input visible again and reload the data source. Only then does it start working correctly.
Example:
<input id="test" style="display: none;>
var data = ["One", "Two"];
$("#test1").kendoAutoComplete({
dataSource: data
});
$("#test1").data('kendoAutoComplete').dataSource.data() // return "undefined"
Is there a workaround or specific configuration to ensure the data() method behaves as expected, even when the input is hidden?
Thank you in advance for your assistance!
I'm trying to retrieve data from the kendoAutoComplete component, but I'm encountering an issue when the input is hidden.
The happy path works perfectly when the input is visible. For example:
<input id="test">
var data = ["One", "Two"];
$("#test1").kendoAutoComplete({
dataSource: data
});
$("#test1").data('kendoAutoComplete').dataSource.data() // return ["One", "Two"]
However, the problem arises when the input is not visible (e.g., using style="display: none;"). I use the same code, but when I call the data() method, it does not return the original data. Instead, it returns undefined until I make the input visible again and reload the data source. Only then does it start working correctly.
Example:
<input id="test" style="display: none;>
var data = ["One", "Two"];
$("#test1").kendoAutoComplete({
dataSource: data
});
$("#test1").data('kendoAutoComplete').dataSource.data() // return "undefined"
Is there a workaround or specific configuration to ensure the data() method behaves as expected, even when the input is hidden?
Thank you in advance for your assistance!