Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141119 | Nov 25,2018 02:02 PM UTC | Nov 27,2018 09:12 AM UTC | ASP.NET MVC - EJ 2 | 6 |
![]() |
Tags: Grid |
function Complete(args) {
if (args.requestType == "paging") {
this.groupModule.collapseAll();
}
}
|
@Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.datasource).Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).ValidationRules(new { required = "true" }).Add();
col.Field("CustomerID").HeaderText("Customer Name").Edit(new { create = "create", read = "read", destroy = "destroy", write = "write" }).Width("150").Add();
col.Field("Freight").HeaderText("Freight").Width("120").Format("C2").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();
col.Field("ShipCountry").HeaderText("Ship Country").ValidationRules(new { required = "true", minLength = 3 }).Width("150").Add();
}).AllowPaging().EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Normal); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).Render()
<script>
var elem;
var dObj;
function create(args) {
elem = document.createElement('input'); // element create
elem.onblur = blurFun; // bind blur function
return elem;
}
function write(args) {
elem.value = args.rowData['CustomerID'] // write the component
}
function destroy() {
elem.remove(); // remove the element when save the grid edited record
}
function read(args) {
return elem.value; // read the edited value
}
function blurFun(event) {
debugger
var gridObj = document.getElementById('Grid')['ej2_instances'][0];
var column = gridObj.getColumnByField(event.target.id.replace(gridObj.element.id, ''));
}
</script>
|
J Mohammed Farook. |
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.