This is a migrated thread and some comments may be shown as answers.

refresh (ajax binding)

5 Answers 1377 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Shahar
Top achievements
Rank 1
Shahar asked on 07 Jul 2013, 07:19 AM

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

Sort by
0
Petur Subev
Telerik team
answered on 10 Jul 2013, 06:55 AM
Hello Shachar,

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
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Internal Licensing
Top achievements
Rank 1
answered on 17 Feb 2016, 07:49 AM

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

0
Georgi Krustev
Telerik team
answered on 19 Feb 2016, 10:18 AM
Hello 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ivett
Top achievements
Rank 1
answered on 25 Nov 2016, 04:38 PM

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 ();

0
Georgi Krustev
Telerik team
answered on 29 Nov 2016, 01:47 PM
Hello Yazmin,

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
Telerik UI for ASP.NET MVC is ready for Visual Studio 2017 RC! Learn more.
Tags
MultiSelect
Asked by
Shahar
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Internal Licensing
Top achievements
Rank 1
Georgi Krustev
Telerik team
Ivett
Top achievements
Rank 1
Share this question
or