asp.net mvc 4 - How to add icon button beside dropdownlist globally using jquery -
i working on mvc4 web application.everything working fine in end of project got 1 new requirement in have show plus icon beside of each dropdownlist present on 20 pages like.
in above picture in item dropdownlist had added icon manually.but want add icon every dropdownlist present in full project. on clicking icon 1 pop-up open text box. user enter new item in , save.
common structure of page :
<div runat="server" id="divformlayout" class="formlayout"> <div class="tabsectionl" style="width: 99%"> <span class="tabsectionheader">item details</span> <table cellpadding="4" cellspacing="4"> <tr> <td> item </td> <td> @if (viewdata["itemdesc"] != null) { @html.dropdownlistfor(m => m.str_itemdsc, (selectlist)(viewdata["itemdesc"]), "-select-", new { @class = "validate[required] cairs_item_dropdown", tabindex = "1" }) } else { @html.dropdownlist("str_itemdsc", new selectlist(""), "", new { tabindex = "1" }) } </td> </tr> </table> </div> </div>
problem : how can add plus icon dynamically beside each dropdownlist.
like so:
$("select").each(function(){ $("<a class='icon or whatever'></a>").insertafter($(this)); });
Comments
Post a Comment