jquery_chained
jquery_chained copied to clipboard
Support for multiple select
Hi,
The current plugin works great, do you have any plans to support multi-select (multiple attribute in select)?
Thanks, Raghu
Here is the code snippet that I had in place:
Line 41: var selected = []; $(parent_selector).each(function() { $(":selected", this).each(function() { selected.push($(this).val()); }); });
Line 56: var hasSelectedClass = false; var classList = ($(this).attr('class') == undefined || "" ) ? [] : $(this).attr('class').split(/\s+/); $.each( classList, function(index, item){ if (jQuery.inArray(item, selected) >= 0) { hasSelectedClass = true; return; } }); if (!hasSelectedClass && !$(this).hasClass(selected_first) && $(this).val() !== "") { $(this).remove(); }
trying to implement multiple select option but just one option value selected. please help
$response[""] = "--"; $response["a1"] = "A1"; $response["a3"] = "A3"; $response["s3"] = "S3"; $response["a4"] = "A4"; $response["s4"] = "S4"; $response["a5"] = "A5"; $response["s5"] = "S5"; $response["a6"] = "A6"; $response["s6"] = "S6"; $response["rs6"] = "RS6"; $response["a8"] = "A8"; $response["selected"] = "s6"; $response["selected"] = "s5"; $response["selected"] = "s4"; print json_encode($response);
is this the correct way to define multiple select
Multiple selects are not supported at the moment.
Hi Prabinkarma,
Did you try the code I posted? Multi-select works for me with that code. My code is based on Version: 0.9.4.
Regards, Raghu
Hi @prabinkarma , I also used @fast-one solution with 1.0.0 version today. It's working fine.