Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147864 | Sep 25,2019 12:57 PM UTC | Sep 30,2019 04:27 PM UTC | ASP.NET MVC | 3 |
![]() |
Tags: Grid |
@(Html.EJ().Grid<Object>("Grid")
----
.ClientSideEvents(eve => eve.ActionComplete("complete")); })
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(80).Add();
col.Field("EmployeeID").HeaderText("Employee ID").EditType(EditingType.DropdownEdit).Width(90).Add();
col.HeaderText("Template").Template("#columnTemplate").Width(100).Add();
})
)
<script>
function complete(args) { // actioncomplete event
if (args.requestType == "beginedit" || args.requestType == "add") {
$("#GridEmployeeID").ejDropDownList({ // dropdown
change: function (args) { // change event of dropdown
var inst = $(".e-grid").data("ejGrid");
var index = inst.selectedRowsIndexes;
if (args.value == 1) {
// changing type and value of template
$(".e-rowcell.e-templatecell").eq(0).find("input")[index[0]].type = "text";
$(".e-rowcell.e-templatecell").eq(0).find("input")[index[0]].value = "jkj";
}
if (args.value == 2) {
-------
}
if (args.value == 3) {
-----
}
}
})
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.