Search code examples
angularjscomboboxkendo-uirefreshreload

How to refresh/reload kendo comboBox dataSource with AngularJs?


I do:

    .data('kendoComboBox').dataSource.read();
    .data('kendoComboBox').refresh();

but comboBox still doesn't reload.


Solution

  • The code you posted in the comments shows that you are trying to reload the combobox's datasource. This will work if comboBoxDataSource is of kendo.data.DataSource type. What I woud suggest you is to use the model $scope.comboBoxListOptions to control the UI:

    $scope.comboBoxListOptions.dataSource.read();
    

    There is no need to call refresh() method after dataSource.read().

    Check this demo for more details: http://dojo.telerik.com/OfIFo

    As a side note, do not use private variables like "_data". It is safer to use the API: