问题描述
[用户界面][1]
这是我的用户界面,通过通知后,我会自动想取消全选并再次打开以供选择 这是我使用 jquery ajax 的 JavaScript 代码。通知通过后,我想更新所选的选择 [myjs][2]
function InsertNotify() {
alertify.confirm('Notify','Are you sure you want to send notification',function () { FNotify(); },function () { alertify.error('Cancel') });
function FNotify() {
var notifyObj = {
supporterid: $(".supporters").val(),HospitalUpdateId: $("#hiddenid").val()
}
$.ajax({
url: "/Notify/InsertNotify",type: "POST",data: notifyObj,success: function (result) {
toastr.success("The notification passed successfully");
$("#dropdown").val('');
$("#dropdown").trigger("chosen:updated");
},error: function (result) {
toastr.error("Error in sending notifications");
}
});
}
}
$("#dropdown").val('') 无效
这是我在前端的代码
@Html.ListBoxFor(model => model.selectedArray,new MultiSelectList(Model.supporters,"Id","Name"),new { id = "dropdown",multiple = "multiple" })
<input type="hidden" id="notifytabtype" name="Type" />
<input type="hidden" id="notifytabid" name="Id" />
<input type="hidden" id="notifyhospitalid" name="HospitalId" />
<button class="btn btn-danger" value="Notify" style="width:60px;height:30px;" id="notifysubmit" onclick="submitter()">Notify</button>
$("#dropdown").chosen(); js显示
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)