Telerik Forums
Kendo UI for jQuery Forum
15 answers
4.4K+ views

I ordered the source, but I can not do it for 'value'.

I use the multiselect with MVVM.

 

 

My html code:

<select id="doc" data-role="multiselect"
data-value-primitive="true"
data-text-field="name"
data-value-field="id"
data-bind="value: valueDoc,
source: sourceDoc"></select>

 

My js code:

vm = kendo.observable({

sourceDoc: new kendo.data.DataSource({
            data: [],
            sort: { field: "name", dir: "asc" }
        })
});

 

The value is not ordered

Andrew
Top achievements
Rank 1
Iron
Iron
 answered on 01 Feb 2021
1 answer
568 views

I followed this example to add values to the multiselect without using a popup, but I noticed that whenever the multiselect loses its focus, the text that has been typed on it disappears.

I wish to avoid this behavior, since it would be annoying to a user to type something and click somewhere else and that value to be lost.

Is this possible?

Martin
Telerik team
 answered on 09 Nov 2020
6 answers
970 views
Currently the multiselect widget gets wrapped in a div, causing it to move to a newline. Other similar widgets like the dropdownlist do not. Is there a way I can make the multiselect widget not move to a newline?

I tried setting the display to be 'inline-block', but then it shifted the multiselect to be 'hovering' above the available data.

http://imgur.com/GiQURfS
Stoyan
Telerik team
 answered on 02 Nov 2020
4 answers
559 views

Hi, we have some multiselect with tons of data (about 5000+).

 

That makes the "dom" very charged and the ui slow.

We found a part of the solution, in that dojo:

https://dojo.telerik.com/@foxontherock/oDerIDAg/3

DOM is very light as we only display first 50 items, and if the user "search" for the items, it finds it on any page. The value is correctly set.

But, when I load the item with values, they are not set if they are not on page 1.  

But, the solution is near, as they are correctly set when we select it from a search...

Do you need to fix something, or is there an easy solution I can do to make the items correctly set initially?

Thank you.

Petar
Telerik team
 answered on 06 Oct 2020
1 answer
810 views

hello every body.

i have a multiselect widget which i want to have fixed height and if items are more than the width , it should scroll vertically instead of increasing height size.
i used this css class and everything is fine in chrome. it has a vertical scroll bar.

.k-multiselect-wrap{height:30px;overflow:auto}

but when i open my project in firefox the scrollbar is not there , and i just can scroll vertically with mouse wheel.

could you please help me to fix this issue ?

 
 
 
 
Martin
Telerik team
 answered on 08 Sep 2020
2 answers
141 views

I notice that kendo has a new feature to customize the noDataTemplate. Then you can use that to allow user adding a new item when there is no match.

Just like this example: http://demos.telerik.com/kendo-ui/multiselect/addnewitem

 

 

But what if I want to add a new item of partial match. Say you have "Chai" in the options, but I want to add "Cha". Can we do that with kendo?

Peter
Top achievements
Rank 1
 answered on 04 Sep 2020
1 answer
240 views

Hi Team,

 

Getting ajax call twice for same input if specifying minLength in multiselect. Could you please suggest why ajax call invoke twice for same input with minLength.

 

HTML:<div><select id="required" multiple="multiple" style="width: 92.5%; margin-top: 21px; margin-left: 2px;" "></select></div>

 

JS Code:  

var searchuserdataSource = new kendo.data.DataSource({
        pageSize: 30,
        serverFiltering: true,
        transport: {
            read: function (options) {
                var srctxt = {
                    //searchText: $('#required').data("kendoMultiSelect").input.val()
                    searchText:"Test"   
                };

                var params = "{searchText: '" + srctxt.searchText + "'}";
                $.ajax({
                    type:"POST",
                    url: "./Relationships.aspx/GetUserSearch",
                    data: params,
                    dataType: "json",
                    contentType: "application/json; charset=utf-8",
                    success: function (result) {
                        var userslist = [];
                        if (typeof result.d !== 'undefined' && result.d.Completed)
                        {
                            $.each(result.d.Data, function (i, item) {
                                var map = {};
                                map["id"] = item.Id;
                                map["name"] = item.DisplayName;
                                userslist.push(map);
                            });
                           
                        }
                        options.success(userslist);
                    },
                    error: function (result) {
                        options.error(result);
                    }
                });  
            }
        }
    });


$("#required").kendoMultiSelect({
    autoBind: false,
    minLength: 3,
    enforceMinLength: true,
  dataSource: searchuserdataSource,
  dataTextField: "name",
  dataValueField: "id",
//itemTemplate :"<input type='checkbox' id='#:data.id#'/> #:data.name#",
  //itemTemplate: " <input type='checkbox' name ='#:data.name #' value ='#:data.id#' class='k-checkbox' /><label class='k-checkbox-label' value='#:data.id#' > #:data.name# </label>",
//itemTemplate:"<input type='checkbox' name='#:data.name # value='#:data.id #' class='k-checkbox' />" +
        //"<span class='k-checkbox-label' data-value='#:data.id #'>#:data.name #</span>";
  autoClose:false,
  tagMode:"single",
  //tagTemplate:'<span>#: data.values.length # user(s) selected</span>',
    filter: "contains",
    //placeholder: "Search..",
    delay: 200,
  close: function(){
           var selectedItems =$("#required").data("kendoMultiSelect").dataItems();
           if(selectedItems.length !=0)
              {
                 $.each(selectedItems,function(index,obj){
                       //alert("Name: "+obj.name+"\n"+"Id:"+obj.id+"\n");
                        CreateUsersFilter(obj.id,obj.name);
            
              });
             if (dummyfiltersource.length >= 14)
              $(".selectedusersgrid").width("94%");
             }

 }
});     

Aleksandar
Telerik team
 answered on 31 Aug 2020
4 answers
81 views

Hi, 

As my title says, when I clear selected values in the input, additional values selected.

See Dojo: https://dojo.telerik.com/UgOVISOL

Duplicate:
1) Open the widget and select an element under the Customer Location group
2) Close the widget
3) Click the X button on the tag to remove the selected Customer Location.

See how it adds an additional value to the selected list. This is somehow linked to the filtering in the change callback because when I remove the change callback, it works fine. N.B. this only happens when clearing the value using the X, if the value is deselected, all is fine

The desired behaviour is that when a customer location is selected, the customer accounts in the datasource are filtered by the selected customer location. This part is working though.

Thanks, 
Grant

Martin
Telerik team
 answered on 18 Aug 2020
1 answer
75 views
Hi Telerik,
Is there any way that we can do to scroll multiselect content horizontally?
Nencho
Telerik team
 answered on 06 Jul 2020
2 answers
5.3K+ views
Good morning I have to realize multiselect with checkbox.
The final result will be very similar to this:
http://embed.plnkr.co/OVPTCV/
This example, however, is very old and I noticed that with the 2018 version of kendo it does not work perfectly.
It is possible to have the same result using the version of kendo 2018 which seems to me to use different approaches. (eg tagtemplate)

Joabe
Top achievements
Rank 1
 answered on 17 Jun 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?