Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143253 | Mar 11,2019 07:58 PM UTC | Mar 12,2019 10:46 AM UTC | ASP.NET MVC | 1 |
![]() |
Tags: Grid |
@(Html.EJ().Grid<Object>("FlatGrid")
………………………………………….
.ClientSideEvents(eve => { eve.ActionComplete("complete"); })
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.InlineFormTemplate).InlineFormTemplateID("#template"); })
……………..
.Columns(col =>
{
col.Field("ShipCity").HeaderText("ShipCity").EditType(EditingType.DropdownEdit).IsPrimaryKey(true).Width(80).Add();
col.Field("CustomerID").Visible(false).Add();
col.Field("Freight").HeaderText("Qty").TextAlign(TextAlign.Right).Width(75).Add();
col.Field("ShipCountry").HeaderText("Cost").TextAlign(TextAlign.Right).Width(75).Add();
}))
<script id="template" type="text/template">
<table cellspacing="10">
<tr>
<td>ShipCity</td>
<td>
<input type="text" id="ShipCity" name="ShipCity" value="{{:ShipCity}}" />
</td>
</tr>
<tr>
<td>Freight</td>
<td>
<input type="text" id="Freight" name="Freight" value="{{:Freight}}" />
</td>
</tr>
<tr>
<td>ShipCountry</td>
<td>
<input type="text" id="ShipCountry" name="{{:ShipCountry}}" />
</td>
</tr>
</table>
</script>
<script>
function complete(args) {
$("#ShipCountry").ejNumericTextbox();
$("#Freight").ejNumericTextbox();
$("#ShipCity").ejDropDownList({ enableFilterSearch: true, width: "100%", dataSource: window.gridData, fields: { text: "ShipCity", value: "ShipCity" } }); // render the html element to a desire jscontrol here.
}
</script>
|
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.