Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141723 | Oct 21,2017 08:43 AM UTC | Dec 31,2018 11:05 AM UTC | ASP.NET MVC - EJ 2 | 3 |
![]() |
Tags: Grid |
<ej-grid id="FlatGrid" allow-paging="true" action-begin="begin" action-complete="complete">
<e-datamanager json="(IEnumerable<object>)ViewBag.datasource" update-url="Home/NormalUpdate" insert-url="Home/NormalInsert" remove-url="Home/NormalDelete" adaptor="remoteSaveAdaptor" />
<e-edit-settings allow-adding="true" allow-editing="true" allow-deleting="true" edit-mode="@(EditMode.Dialog)"></e-edit-settings>
<e-toolbar-settings show-toolbar="true" toolbar-items="@(new List<string>() {"add","edit","delete","update","cancel" })"></e-toolbar-settings>
<e-columns>
<e-column field="OrderID" header-text="Order ID" is-primary-key="true" is-identity="true" validation-rules='new Dictionary<string, object>() { {"required",true}, {"number",true} }' text-align="Right" width="75"></e-column>
<e-column field="CustomerID" header-text="Customer ID" validation-rules='new Dictionary<string, object>() { {"required",true}, {"minlength",3} }' width="80"></e-column>
<e-column field="EmployeeID" header-text="Employee ID" edit-type="@(EditingType.Dropdown)" text-align="Right" width="75"></e-column>
|
|
public ActionResult DialogInsert([FromBody]CRUDModel<Orders> myObject)
{
Random ran = new Random();
myObject.Value.OrderID = ran.Next();// For isIdentity column, need to generate a new value while inserting new record.
order.Insert(0, myObject.Value);
return Json(order);
} |
<e-column field="OrderID" header-text="Order ID" is-primary-key="true" is-identity="true" visible="false" validation-rules='new Dictionary<string, object>() { {"required",true}, {"number",true} }' text-align="Right" width="75"></e-column> |
|
.e-dlg-content .e-insertedrow .e-gridform.e-formvalidator .e-table tbody tr:first-child {
display: none;
}
|
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.