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

Radio buttons lose their selection once sorted

7 Answers 102 Views
Sortable
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 2
Veteran
Steve asked on 23 Mar 2017, 06:13 PM

So this is odd...

My markup has radio buttons in each sortable item.  I can select them no problem, but once I start to drag to sort, I can see the hint and placeholder have lost the selection, and on drop it's gone as well.

WIERDER if I inspect the markup in chrome on the dropped element I still to see the "checked" attribute there... but no selection, jQuery detects no selection as well.

Checkbox lists however seems perfectly fine

7 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 27 Mar 2017, 04:23 PM

Hello Steve,

Could you please confirm that you can replicate the described behavior with our http://dojo.telerik.com/uTICu example? When I drag the item with the check box the hint still shows a check box that is checked. 

Regards,
Boyan Dimitrov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Steve
Top achievements
Rank 2
Veteran
answered on 27 Mar 2017, 04:26 PM

Man terrible timing, I literally just submitted a ticket this minute

Yeah so "checkbox" works fine, radio does not though, sorry I mentioned that above, but wasn't clear

Demo:

https://jsbin.com/xegiku/edit?html,output

0
Viktor Tachev
Telerik team
answered on 28 Mar 2017, 12:09 PM
Hello Steve,

I have replied to your query in the support ticket you have submitted. Please give the approach a try and let me know how it works for you.

Regards,
Viktor Tachev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Alexandre Jobin
Top achievements
Rank 1
answered on 06 Sep 2017, 01:31 PM

Hi Victor,

I'm having the same problem as Steve, is it possible to share the solution ?

Thanks in advance.

0
Stefan
Telerik team
answered on 08 Sep 2017, 08:05 AM
Hello Alexandre,

The replay consisted of the following guidances and example:

I can suggest using the mousedown event of the radio button and keep track of the selected item. Then you can handle the end event for the sortable widget to select the input. The example below illustrates the approach:

http://dojo.telerik.com/OTEwu/2
 
Also, please note the following specific- The code for the Sortable components does not the affect the selection of checkboxes or radio buttons. However, when you drag an item it is cloned with jQuery. As a result, this will create a new group of radio buttons with the same name. However, there is already one checked item in that group. Thus, the new radio buttons are not checked.

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Thomas
Top achievements
Rank 1
answered on 20 Nov 2019, 06:04 PM

Hello Stefan,

Its still broken http://dojo.telerik.com/IwUXIMaV/2 select item 2 radio button in the first select item 1 radio button in the second. Then drag item 1 above item 2 and drop it you will see both select item 2. So really no one can use drag and drop if they have radio buttons. I am currently on the newest version of Kendo and its still an issue. Will there ever be a fix?

Thanks,

Thomas

0
Viktor Tachev
Telerik team
answered on 22 Nov 2019, 08:56 AM

Hi Thomas,

 

Thank you for the provided dojo. After running it I noticed that there was a JavaScript error when dragging the item without radio buttons in it. To prevent the error I included a condition that checks if there is a radio button before checking it. 

After the modification the sample was working as expected on my end.

http://dojo.telerik.com/IwUXIMaV/4

 

Give it a try and let me know how it works for you.

 

Regards,
Viktor Tachev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Sortable
Asked by
Steve
Top achievements
Rank 2
Veteran
Answers by
Boyan Dimitrov
Telerik team
Steve
Top achievements
Rank 2
Veteran
Viktor Tachev
Telerik team
Alexandre Jobin
Top achievements
Rank 1
Stefan
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or