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

Issue using value() method within change and select events

10 Answers 386 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 25 Mar 2013, 02:52 PM
This is mentioned in another post, but since it might be a bug, I thought a separate thread was appropriate.

It seems like when I try to manipulate the data source (add and remove items), and then try to update the value() of the multiselect, it fails.

This is demonstrated in this jsbin.  Note that in edit mode, for some reason jsbin does not allow inputting text into the multiselect (not sure if this is a jsbin bug or a kendo bug) - so you'll have to use the preview version to demonstrate the issue.

http://jsbin.com/ucimay/3/edit
http://jsbin.com/ucimay/3 (text input doesn't seem to work in edit mode, but works in preview mode)

My main goal is to allow users to add new items to the multiselect.  As you will see from the example above, you can add one new item, but as you add more items, it only retains the most recent one.  For example, type "abc", then select that item.  Then type "def" and select that one.  Only "def" is selected.  I've confirmed that when I print the contents of the data source, both "abc" and "def" exist.  I've also confirmed that I'm passing ["abc","def"] to the value() method.

Is this a bug that could be fixed with this week's internal build?

  Nick

10 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 26 Mar 2013, 08:35 AM
Hello Nick,

 
The value method works as expected. It just accepts flat array of data and will not work with [value, newtag], where value is an array to. Also value method cannot select items which cannot be fined in the DataSource's view and that is why when you need to clear applied filter before setting values. Check the updated jsBin demo.

On a side note, I will ask you to continue our conversion in only one thread in order to avoid any duplications.

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
Jeff
Top achievements
Rank 1
answered on 26 Mar 2013, 02:38 PM
Thanks Georgi,

I actually view these as two separate issues, but I'll go ahead and mark this one as answered since it addresses the issue mentioned in the title, and I'll post one last thing in the other thread for the sake of other users who are interested in that use case.

  Nick
0
Daniel
Top achievements
Rank 1
answered on 08 Jul 2016, 06:14 PM

jsBin Demo does not work on newer Kendo versions.

If I take the same jsBin Demo and just change the folder path to 2016.2.607 it erases the first new tag added when you try to add another new tag.

Thanks

0
Georgi Krustev
Telerik team
answered on 12 Jul 2016, 08:19 AM
Hello Daniel,

Several major MultiSelect features were brought out through the years, which forced us to introduce some breaking changes in the widget implementation:

http://docs.telerik.com/kendo-ui/backwards-compatibility/2015/2015-backward-compatibility

Indeed, the jsBin demo does not work with the latest versions of Kendo UI due to the changes that I've already mentioned. In general, we do not guarantee backward compatibility to the custom solutions (not officially supported) shared in the forums and the developers should maintain the code on their own.

For your convenience, I am sharing a how-to demo that demonstrates how to add new items into MultiSelect:

http://dojo.telerik.com/@ggkrustev/UxOvO

The demo uses the latest official release of Kendo UI. You can use it as a reference to accomplish your business requirement.

As a side note, we are working on a better solution exactly for such integration between popup widgets and the need of CRUD operations. You can find more details here:

http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/suggestions/4545733-multiselect-new-items

Regards,
Georgi Krustev
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Daniel
Top achievements
Rank 1
answered on 12 Jul 2016, 01:31 PM

Hello,

  The Dojo you posted does not appear to work. 

Are you supposed to be able to dynamically add information to the multi select?  Right now it just filters when you type information in.

0
Georgi Krustev
Telerik team
answered on 14 Jul 2016, 07:07 AM
Hello Daniel,

The new custom item will be appended when a "," (comma) is typed. This is how the specific functionality is implemented in this how-to demo. As I mentioned in my previous response, you can use the demo as a reference to implement the desired functionality manually.

If you need further assistance on this matter, then I would suggest you contact our Professional Services, which are specialized in such custom scenarios.

Regards,
Georgi Krustev
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
LST
Top achievements
Rank 1
answered on 25 Jul 2016, 02:17 AM

Is there any way to prevent the tags from jumping positions when the user uses this function to add new item? Please see the following screencast (the tags start to go out of order after keying in the 3rd item):

http://screencast.com/t/cj8cILTUj

 

0
Georgi Krustev
Telerik team
answered on 26 Jul 2016, 10:31 AM
Hello,

The order of the selected tags is directly related to the order of the data items in the dataItems collection. If the tags are shuffled, then the dataitems collection is shuffled too.

In order to avoid this behavior, then you will need to take control over the orders of the selected data items. You can sort the dataItems collection and re-render the list after that.

Regards,
Georgi Krustev
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Raj
Top achievements
Rank 1
answered on 30 Jan 2018, 10:17 PM

Hello

I have a datasource with 2500 records. and iam binding all of them on page load which works well with small number like 100, 50 but if i bind all 2500 items at a time multiselect doesn't seem to populate.

here i sample code

  @(Html.Kendo()
                    .MultiSelect()
                    .Name("test")
                    .Enable(false)
                    .AutoBind(false)
                    .Value(Model.Ids)
                    .BindTo(Model.Ids)
                    .DataTextField("Name")
                    .DataValueField("Id")
                    .HtmlAttributes(new { style = "width:80%" })
                    .DataSource(ds =>
                    ds.Read(read => read.Action("GetIdList", "Controller").Type(HttpVerbs.Get)
                    ))
                )

tried virtualization but didn't work.

Thanks

raj

0
Neli
Telerik team
answered on 01 Feb 2018, 12:44 PM
Hello Raj,

I have prepared a sample project based on the provided code.
In the project the MultiSelect widget is loading 2500 items without using the virtualization. May I ask you to modify the provided sample in order to reproduce the issue the way it is at your end? This will help us to run it locally and provide further assistance.

Regards,
Neli
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
MultiSelect
Asked by
Jeff
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Jeff
Top achievements
Rank 1
Daniel
Top achievements
Rank 1
LST
Top achievements
Rank 1
Raj
Top achievements
Rank 1
Neli
Telerik team
Share this question
or