Able to clone the dropdown with values. It's working fine in the first row but when I click the glyphicon for cloning the another row the dropdown control froze (Nothing happened).
@Html.DropDownList("searchfieldsDropdownList", new SelectList(Model.DataDictionary, "ID", "BLSName"), "", new { @class = "**chosen-select**" })
$("**.chosen-select**").chosen();
$(".glyphicon-plus").click(function () {
$(this).closest("tr").clone(true).appendTo("#ruleTable");});
Initialize the plugin on the new select after you insert it
Something like:
$(".glyphicon-plus").click(function () {
var $row = $(this).closest("tr").clone(true).appendTo("#ruleTable");
$row.find('.chosen-select').chosen()
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.