Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
148170 | Oct 8,2019 11:49 PM UTC | Oct 17,2019 10:45 AM UTC | ASP.NET MVC - EJ 2 | 3 |
![]() |
Tags: Grid |
[Index.cshtml]
@{
ViewBag.Title = "Home Page";
}
<h3><i>FORMULA GRID(Destination Grid)</i></h3>
@Html.EJS().Grid("FormulaGrid").DataSource(ds => ds.Json(ViewBag.PFGridData).UpdateUrl("/Home/Update").InsertUrl("/Home/Insert").RemoveUrl("/Home/Remove").Adaptor("RemoteSaveAdaptor")).Columns(col =>
{
. . . .
}).AllowPaging().EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).AllowRowDragAndDrop().Render()
<h3><i>PRODUCTO FORMULA GRID(Source Grid)</i></h3>
@Html.EJS().Grid("ProductoForumlaGrid").DataSource(ds => ds.Json(ViewBag.dataSource).UpdateUrl("/Home/SrcUpdate").InsertUrl("/Home/SrcInsert").RemoveUrl("/Home/SrcRemove").Adaptor("RemoteSaveAdaptor")).Columns(col =>
{
. . . .
}).AllowPaging().EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).AllowRowDragAndDrop().RowDropSettings(new Syncfusion.EJ2.Grids.GridRowDropSettings() { TargetID = "FormulaGrid" }).RowDrop("FormulaDropAction").Render()
<script>
function FormulaDropAction(args) {
var DestGrid = document.getElementById("FormulaGrid").ej2_instances[0]
var SrcGrid = document.getElementById("ProductoForumlaGrid").ej2_instances[0];
var idx = parseInt(args.target.getAttribute('index'));
SrcGrid.deleteRecord("OrderID", args.data); // Remove a drag element from the Source Grid
DestGrid.addRecord(args.data[0], DestGrid.currentViewData.length); // Added a drop row in the Destination Grid
args.cancel = true;
}
</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.