Paulsonps / dropdown-check-list

Automatically exported from code.google.com/p/dropdown-check-list
0 stars 0 forks source link

Single dropdown: re-selecting item unchecks radio #249

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I'm using the single dropdownchecklist on some selects. When I click on an 
item, the radio input gets checked as it should. However, I noticed that when 
someone clicks again on the same item, but next to it's text, the radio gets 
deselected, while if you click on the text it doesn't (like it should). The 
consequence is that one should only click on the item's text and not next to it 
(but still within the item "button"). Doing so allows one to leave all radio's 
unchecked.

Can this be fixed? If I'm not stating the problem clearly, please let me know.

Thanks, Carlo

Original issue reported on code.google.com by carlober...@gmail.com on 18 Jun 2012 at 1:47

GoogleCodeExporter commented 8 years ago
Good Catch -- I am guessing that while the control itself (the button and its 
associated text) is wired to 'on', the outer wrapper div is wired to 'toggle'.  
Toggle makes sense for a checkbox display, but not for a radio button.

I will try to get this fixed in the next release.

Original comment by womohun...@ittrium.com on 18 Jun 2012 at 4:29

GoogleCodeExporter commented 8 years ago
Thanks for your quick reply.

For now I temporarily solved it by adding the following parameter to the 
$.dropdownchecklist() call:

onItemClick: function (checkbox, selector) {
    var justChecked = checkbox.prop("checked");
    var checkCount = (justChecked) ? 1 : -1;

    // count selected items total
    for (i = 0; i < selector.options.length; i++) {
        if ( selector.options[i].selected ) checkCount += 1;
    }
    // check if less than one item is selected
    if (checkCount < 1 ) throw "too few";
}

Original comment by carlober...@gmail.com on 19 Jun 2012 at 12:24

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I have problem for sigle select dropdown list. I want the radio button for 
sigle select. I get it from this plugin. I have one option value -1 with All as 
a text. but this value is not clickable. How can I make this clickable. Also I 
remove that value in this every first value for checklist is not clickable. How 
can I solve this problem

I want quick reply

Original comment by nishants...@gmail.com on 10 May 2013 at 6:01