EhabBug / dropdown-check-list

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

span.ui-dropdownchecklist-text Group header text does not respond to click event #252

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

I'm using optgroups for my dropdownchecklists. Now I want to make a function in 
a separate javascript which checks all items within a group when clicking on 
the group text. The group text exists of a div.ui-dropdownchecklist-group which 
contains a span.ui-dropdownchecklist-text. The first step would be to capture 
the click on this last element, span.ui-dropdownchecklist-text. When using a 
'click' event, it doesn't respond, but when I use 'hover' it does.. The 
function looks like this:

$(document).ready(function(){
    $('body').on('click', 'div.ui-dropdownchecklist-group > span', function(){
        alert('init');
    });
});

So this doesn't work. However when I change 'click' into 'hover', it does work 
and the alert gets triggered. So far I haven't found the problem, does anyone 
know a solution? I rather wouldn't edit the plugin but create a solution in an 
external jquery function, so I don't have to edit the plugin each time it is 
updated.

Besides it would be very welcome if in the next plugin update an option wil be 
available to select every group item by clicking the group text.

Thanks in advance

Original issue reported on code.google.com by carlober...@gmail.com on 25 Jun 2012 at 12:07

GoogleCodeExporter commented 8 years ago
Update:
I found out it's the e.stopImmediatePropagation(); on line 376 which prevents 
triggering the click event on the group text. Is there a way to bypass this 
without editing the plugin code? (maybe 'unbinding' this 
stopImmediatePropagation if possible?)

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

GoogleCodeExporter commented 8 years ago
It seems you are looking for the enhancement described in item #24.  There are 
already some posting addressing this issue, and I hope to roll this feature 
into the next release.

Original comment by womohun...@ittrium.com on 25 Jun 2012 at 1:40