0
如何將網格中所選行的PreEmploymentId傳遞給網格中按鈕單擊事件的窗口。這可能很簡單,但我是新的,仍然在學習基礎知識。如何將值從kendo網格傳遞到MVC中的kendo窗口
腳本 -
<script>
$("[data-button-type='auction']")
.click(function(e) {
myWindow.data("kendoWindow").open();
myWindow.data("kendoWindow").center();
myWindow.data("kendoWindow").top();
});
</script>
劍道併網
<div >
@*Telerik grid*@
@{
Html.Kendo().Grid(Model.LstPreEmploymentWorkflowModellist)
.Name("MyGrid")
.Columns(col =>
{
//on edir button click action name Main in invoked in PreEmploymentWorkflow controller and PreEmploymentId is passed
col.Template(@<text>
@Html.ActionLink("Edit", "Main", "PreEmploymentWorkflow", new {Id = item.PreEmploymentId}, new {@class = "classname"})</text>).Width(30);
col.Bound(o => o.PreEmploymentId).Visible(false).Groupable(false);
col.Bound(o => o.FirstName).Width(30).Groupable(false);
col.Template(@<text>
@Html.ActionLink("OpenFile", "Openfile", "PreEmploymentWorkflow", new {Id = item.PreEmploymentId, uploadfilename = "EEOC Tracking Form"}, new {@class = "classname3"})</text>).Title("EEOC").Width(30);
col.Template(@<text>@(Html.Kendo().Button()
.Name("open" + @item.PreEmploymentId)
.ImageUrl(Url.Content("/images/auction_16.gif")).HtmlAttributes(new {type = "submit", data_button_type = "auction" })
)
</text>).Width(40).Title("Status");
col.Template(@<text>
@Html.ActionLink("Delete", "Delete", "PreEmploymentWorkflow", new {Id = item.PreEmploymentId}, new {@class = "classname2"})</text>).Width(30);
})
//.HtmlAttributes(new { style = "width: 1100px" })
.Sortable()
.Render();
}
劍道窗口 -
@{Html.Kendo().Window()
.Name("window")
.Width(500)
.Height(315)
.Animation(true)
.Draggable()
.Visible(false)
.Modal(true)
.Title("Employment Status")
.Actions(actions => actions.Close())
.Content(@<text>
@using (Html.BeginForm("CreateStatus", "PreEmploymentWorkflow", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<table>
<tr>
<td>
@(Html.Kendo().TextBoxFor(m => m.LstPreEmploymentWorkflowModel.PreEmploymentId))
</td>
<td>
@(Html.Kendo().RadioButtonFor(m => m.LstPreEmploymentWorkflowModel.Status).Value(1).Label("Approved"))
</td>
<td>
@(Html.Kendo().RadioButtonFor(m => m.LstPreEmploymentWorkflowModel.Status).Value(9).Label("Reject"))
</td>
</tr>
<tr>
<td>
<label class="Bold" for="statusattachment">Status Attachment:</label>
</td>
<td><input type="file" name="uploadfilestatus"/></td>
</tr>
<tr>
<td>
<input id="Button1" type="submit" value="Submit"/>
</td>
</tr>
</table>
}
</text>)
.Render();
}
在此先感謝。
謝謝您的回覆。我試圖給出,但它是以html格式給出的。我希望它作爲模型的對象,以便我可以將按鈕單擊事件上的值傳遞到數據庫中。 – Swapnil