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

Is possible to set selected values of the multiselect which are not part of the current multiselect client values: currently, bounded data of the mult

3 Answers 782 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Baha Ganayim
Top achievements
Rank 1
Baha Ganayim asked on 28 Mar 2013, 02:12 PM


 

 

 
Hi, 
 Is possible to set selected values of the multiselect which are not part of the current multiselect client values:  currently, bounded data  of the multilist


When working  with datatasource  which is OData Service, not all data is brought to the client.(All the data is found on the server).  But we still need to mark the selected values of the
multilist. Part of them is not on the client currently

Thanks,

 

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 29 Mar 2013, 04:06 PM
Hello Baha,

 
MultiSelect widget allows to select only items, which ara part of the DataSource's view. If you need to show selected items on initial load when widget is not bound yet, then you can use the following approach.

Kind regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
TomW
Top achievements
Rank 2
answered on 08 Aug 2013, 01:46 PM
Hi

I am using the above example, however I need to track when an item is removed., I currently use the below code to track items which have been deleted from the multiselect.  This works fine for items added during a normal search, but if I have preloaded the selected values, it doesnt find them?

change: function (e) {
            var previous = this._savedOld;
            var current = this.value();
            var diff = [];
            if (previous) {
                diff = $(previous).not(current).get();
            }
            this._savedOld = current.slice(0);
            // diff has the elements removed do whatever you want...
 
            if (diff.length > 0) {
                var urltag = "../Dashboard.svc/TagsDelete?EventOrJobNo=" + gridRowToolTipJson.JobNo + "&Tag=" + diff[0];
 
                $.ajax({
                    // type: "POST",
                    type: "GET",
                    contentType: "application/json; charset=utf-8",
                    url: urltag,
                    dataType: "jsonp",
                    success: function (data, textStatus, xmlHttp) {
 
 
                    }
                });
            }
        },
0
Atanas Korchev
Telerik team
answered on 12 Aug 2013, 08:12 AM
Hello Tom,

 I tried a similar approach to yours which seems to work ok. Here is a live demo: http://jsbin.com/atoqox/1/edit

Regards,
Atanas Korchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
MultiSelect
Asked by
Baha Ganayim
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
TomW
Top achievements
Rank 2
Atanas Korchev
Telerik team
Share this question
or