Kendo multiselect control - Remove selected items from dropdown
Asked Answered
B

2

6

I have kendo multi-select control on my asp.net mvc view.

Whenever user select values from the control, it is visible on two places 1. On the textbox area and 2. highlighted item on the dropdown list.

I want to remove the selected items from the drop down list and to show only on the textbox area.

Actually, It was working as expected on the previous version but after upgrading to latest version it is visible in both places(1. on the textbox area and 2. highlighted in the dropdown as well.)

I understand this was an additional cosmetic change provided in the latest version. Just trying to see if there is any property i can handle it to display only on the textbox area and not to highlight in the dropdown list.

Beaconsfield answered 8/4, 2015 at 17:31 Comment(1)
Can you please share the code or host it jsFiddle or jsBin and share the link ??Iaea
E
5

One option is to hide them with css

.hide-selected > li.k-state-selected{
    display: none;
}

Make sure to add the hide-selected class to your multiselect.

multiselectwidget.ul.addClass('hide-selected');
Empery answered 28/8, 2015 at 1:1 Comment(0)
B
0

This question is quite old but hopefully this will help someone in the future.

Attach an event to your MultiSelect

.Events(e =>
{
  e.Change("onChange");
})

Then add a JavaScript function to handle the hiding

function onChange() {
    $('li.k-state-selected').hide();
}

This will hide all the items you select as you select them.

Brindled answered 6/9, 2018 at 15:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.