Hi,
I configured the Kendo MultiSelect for ajax binding, I send parameters to the server, All as described in
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/multiselect/overview#sending-parameters-to-the-server
Everything works fine except my call to the refresh method (http://docs.kendoui.com/api/web/multiselect).
The thing is that a new ajax request does not occur when I call refresh (is it by design? should I use another API?),
I need the List Of Values to be updated by a new Ajax call on change of another control.
The parameters I send to the server are
1. the text typed
2. a value of another control
Thanks in advanced,
Lauri
5 Answers, 1 is accepted
The refresh method of the MultiSelect will redraw (re-render) the widget as described in the documentation. To perform re-fetch of the data from the server you should use the read method of the dataSource.
//if you have specified data function
//you just need to call the method like this
$(
'#myMultiSelect'
).data(
'kendoMultiSelect'
).dataSource.read();
//or you can send extra parameters like this
$(
'#myMultiSelect'
).data(
'kendoMultiSelect'
).dataSource.read({text:$(
'#someInput'
).val()});
Kind Regards,
Petur Subev
Telerik

Hello Petur Subev,
can I create a complete object instead if {text:$('#someInput').val()} to re-read. I need this functionality to reset the box to the state before changing. I store the dataSource and value and dataItems, but what can I do to reset the control?
My original question you will found here:
http://www.telerik.com/forums/how-to-prevent-multiselect-from-deleting-items
Kind regards,
Oliver
My colleague already answered to the other thread opened you mentioned. I would like to ask you continue discussion in only one thread to avoid duplication.
Regards,
Georgi Krustev
Telerik

Hi,
I need Refresh data in multiselect after add new item in my database.
To the add new item send in ajax JQuery and to the return in part the success i need refresh multiselect .
Could you tell me some way to do it?
Since in other components like the grid we can refresh it as something like this
$ ( '# Multi'). Date ( 'kendoMultiselect'). Refresh ();
In general, the MultiSelect widget also has refresh method:
http://docs.telerik.com/kendo-ui/api/javascript/ui/multiselect#methods-refresh
This method will re-render the multiselect popup items, which will happen anyway if the source is updated. You can see how we add new items in the MultiSelect source here:
http://demos.telerik.com/kendo-ui/multiselect/addnewitem
As you can see once, the source is updated, the list is re-rendered.
Let me know if I am missing something.
Regards,
Georgi Krustev
Telerik by Progress