Webgrid 列包含下拉列表 onchange 下拉列表必须在对象中更新我想要行或对象的唯一 ID
示例代码:-
<script type="text/javascript">
function ViewDataChange() {
alert("In");
}
function GetPage(data) {
debugger;
var item = document.getElementById("AppId").value;
var i=0;
for (i = 0; i < data.length; i++) {
if (data[i].selected) {
var selectedRole = data[i].value + "#" + item;
$.getJSON("/Calls/SelectedBookingRole", { Id: selectedRole }, function (d)
});
break;
}
}
}
@{using (Ajax.BeginForm("DeleteAttendee", "Calls", new AjaxOptions { UpdateTargetId = "GridAttendee", HttpMethod = "Post", LoadingElementId = "LoadingImageAttendees" }))
{
@usersGrid.GetHtml(
htmlAttributes: new { OnItemCreated = "this.ViewDataChange()" },
tableStyle: "grid TBLGrid",
mode: WebGridPagerModes.Numeric,
headerStyle: "header",
alternatingRowStyle: "alt",
rowStyle: "row",
columns: usersGrid.Columns(
usersGrid.Column(null, null, format: @<input type="hidden" name="AppId" value="@item.AppUserId"/>, style: "", canSort: false),
usersGrid.Column("Name", "Name ", style: "", canSort: false),
usersGrid.Column("ListItemId", "Booking Role", format: (item) => Html.DropDownList("ddlBookingRole", ViewBag.BookingRoleList as SelectList, new { onchange = "GetPage(this);" }), style: "width:70%", canSort: false),
usersGrid.Column("PortaCallParticipantId", "Delete", format: @<input type="image" src="../../Content/images/deleteIcon.gif" name="Id" value="@item.AppUserId" />, style: "align:center", canSort: false)
)
)
}
}
我想在 GetPage(this,@item.AppUserId)
中传递两个参数,但我不知道如何做同样的事情,请建议我紧急 提前致谢。
Sample code:-
<script type="text/javascript">
function ViewDataChange() {
alert("In");
}
function GetPage(data) {
debugger;
var item = document.getElementById("AppId").value;
var i=0;
for (i = 0; i < data.length; i++) {
if (data[i].selected) {
var selectedRole = data[i].value + "#" + item;
$.getJSON("/Calls/SelectedBookingRole", { Id: selectedRole }, function (d)
});
break;
}
}
}
@{using (Ajax.BeginForm("DeleteAttendee", "Calls", new AjaxOptions { UpdateTargetId = "GridAttendee", HttpMethod = "Post", LoadingElementId = "LoadingImageAttendees" }))
{
@usersGrid.GetHtml(
htmlAttributes: new { OnItemCreated = "this.ViewDataChange()" },
tableStyle: "grid TBLGrid",
mode: WebGridPagerModes.Numeric,
headerStyle: "header",
alternatingRowStyle: "alt",
rowStyle: "row",
columns: usersGrid.Columns(
usersGrid.Column(null, null, format: @<input type="hidden" name="AppId" value="@item.AppUserId"/>, style: "", canSort: false),
usersGrid.Column("Name", "Name ", style: "", canSort: false),
usersGrid.Column("ListItemId", "Booking Role", format: (item) => Html.DropDownList("ddlBookingRole", ViewBag.BookingRoleList as SelectList, new { onchange = "GetPage(this);" }), style: "width:70%", canSort: false),
usersGrid.Column("PortaCallParticipantId", "Delete", format: @<input type="image" src="../../Content/images/deleteIcon.gif" name="Id" value="@item.AppUserId" />, style: "align:center", canSort: false)
)
)
}
}
I want to pass two parameter in GetPage(this,@item.AppUserId)
but i am not getting how to do the same please suggest me its urgent
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
进而:
and then: