pkpfrench / dropdown-check-list

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

showing multiple dropdownchecklist when dynamicaly selecting items in dropdown check list #306

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
we need some items as selected in dropdownchecklist 

Here we are using the following code 

var Ids = $("#selectedIds").val();
        if (Ids != "") {

           $("#S1").dropdownchecklist({ forceMultiple: true, width: 0 });
            var statusArray = new Array();
            var statusString = new String();
            statusString = Ids.toString();
            statusArray = statusString.split(',');
            for (var i = 0; i < statusArray.length; i++) {
                $("#S1 option:[value='" + statusArray[i] + "']").attr('selected', 'selected');
            }

        }

        $("#S1").dropdownchecklist({
            forceMultiple: true,
            maxDropHeight: 190,
            width: 220,
            onComplete: function (selector) {
                var pcids = "";
                for (i = 0; i < selector.options.length; i++) {
                    if (selector.options[i].selected && (selector.options[i].value != "")) {
                        if (pcids != "") pcids += ",";
                        pcids += selector.options[i].value;
                    }

                }

            }
        });

by using these code we got multiple dropdownlist

Original issue reported on code.google.com by josne...@gmail.com on 15 Nov 2013 at 12:08