MultiColumnComboBox with checkboxes - How do I keep it open? Select All?

1 Answer 307 Views
ComboBox
Tye
Top achievements
Rank 1
Tye asked on 26 Aug 2021, 01:34 PM

I need a MultiColumnComboBox with checkboxes, so I've been playing with this demo:

https://www.telerik.com/kendo-react-ui/components/dropdowns/multicolumncombobox/custom-rendering/

I need two things that I can't figure out. I need the combobox to stay open after selecting a checkbox. I tried stopPropagation and preventDefault, but both gave an error (not a function).

Also, I need a select all. I assume this would go in the header with a custom event handler...any idea how I loop through all the items and select each one?

 

Many thanks!

Tye

1 Answer, 1 is accepted

Sort by
1
Accepted
Ina
Telerik team
answered on 27 Aug 2021, 09:42 AM

Hello Tye,

To make the MultiColumnComboBox popup open you can use the `opened` property.

You can make it a state variable and control the behavior programmatically.

Please check the following API reference for more information about the `opened` property:

https://www.telerik.com/kendo-react-ui-develop/components/dropdowns/api/MultiColumnComboBoxProps/#toc-opened 

I have also prepared the following example, demonstrating a select all example behavior:

https://stackblitz.com/edit/react-n2eh7i-aoogtd?file=app/main.jsx 

In this Stackblitz code, we are adding the Checkbox to the wanted header column. We are using this Checkbox in a controlled state. Inside the `onChange` event handler we are checking the `checked` state value based on the event value and setting the values for the items accordingly.

For more information about the controlled state of the Checkbox you can check the following link:

https://www.telerik.com/kendo-react-ui/components/inputs/checkbox/controlled/#toc-controlling-the-value 

Please let me know if you have any other questions.

Regards,
Ina
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tye
Top achievements
Rank 1
commented on 27 Aug 2021, 08:53 PM

Thank you, Ina. This is very much appreciated!
Tye
Top achievements
Rank 1
commented on 01 Sep 2021, 03:15 AM

Thank you, Ina!
Tags
ComboBox
Asked by
Tye
Top achievements
Rank 1
Answers by
Ina
Telerik team
Share this question
or