Thanks
Hello, thanks for the answer. I am trying to use the
1) Drag and drop feature from one parent to another parent records. (but not move parents & not make child record parents), does the SF grid support this need?
2) CRUD Edit records both parent and child records feature in the Tree Grid & perform CRUD. Are you saying I can achieve this AJAX CRUD for both parent & child records in the hierarchy grid? the sample does not show this. Can you please share a working sample with me for the CRUD & drag+drop as mentioned in the above.
I am not following "s but all the data sources column names should be same" why would someone have 2 table with identical columns & names, it makes no sense... can you please elaborate with a small example. Are you saying some col names should be the same or the full structure should be the same?
Thanks
<div style="float:left;width:50%">
@(Html.EJ().Grid<object>("FlatGrid")
---
.AllowRowDragAndDrop()
.RowDropSettings(drop => drop.DropTargetID("#HierarchyGrid"))
----
.Columns(col =>
{
---
})
.ChildGrid(child =>
{
----
})
)
</div>
<div style="float:right;width:49%">
@(Html.EJ().Grid<object>("HierarchyGrid")
----
.AllowRowDragAndDrop()
.RowDropSettings(drop => drop.DropTargetID("#FlatGrid"))
.Columns(col =>
{
---
})
.ChildGrid(child =>
{
----
})
)
</div>
|
<div style="float:left;width:50%">
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.datasource).UpdateURL("/Grid/Update")
.InsertURL("/Grid/Insert").RemoveURL("/Grid/Remove").Adaptor(AdaptorType.RemoteSaveAdaptor))
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); })
.ToolbarSettings(tool =>
{
tool.ShowToolbar().ToolbarItems(toolitem =>
{
toolitem.AddTool(ToolBarItems.Add);
----
});
})
.Columns(col =>
{
col.Field("EmployeeID").HeaderText("Employee ID").IsPrimaryKey(true).ValidationRules(v => v.AddRule("required", true)).Width(75).Add();
---
})
.ChildGrid(child =>
{
child.Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.childDatasource)
.UpdateURL("/Grid/Update3").InsertURL("/Grid/Insert3").RemoveURL("/Grid/Remove3")
.Adaptor(AdaptorType.RemoteSaveAdaptor))
.QueryString("EmployeeID")
.AllowPaging()
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); })
.ToolbarSettings(tool =>
{
tool.ShowToolbar().ToolbarItems(toolitem =>
{
toolitem.AddTool(ToolBarItems.Add);
----
});
})
.Columns(col =>
{
col.Field("OrderID").HeaderText("OrderID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();
-----
});
})
)
</div>
<div style="float:right;width:49%">
@(Html.EJ().Grid<object>("HierarchyGrid")
.Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.datasource2).UpdateURL("/Grid/Update2")
.InsertURL("/Grid/Insert2").RemoveURL("/Grid/Remove2").Adaptor(AdaptorType.RemoteSaveAdaptor))
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); })
.ToolbarSettings(tool =>
{
tool.ShowToolbar().ToolbarItems(toolitem =>
{
toolitem.AddTool(ToolBarItems.Add);
----
});
})
.Columns(col =>
{
col.Field("EmployeeID").HeaderText("Employee ID").IsPrimaryKey(true).ValidationRules(v => v.AddRule("required", true)).Width(75).Add();
-----
})
.ChildGrid(child =>
{
child.Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.childDatasource2)
.UpdateURL("/Grid/Update3").InsertURL("/Grid/Insert3").RemoveURL("/Grid/Remove3")
.Adaptor(AdaptorType.RemoteSaveAdaptor))
.QueryString("EmployeeID")
.AllowPaging()
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); })
.ToolbarSettings(tool =>
{
tool.ShowToolbar().ToolbarItems(toolitem =>
{
toolitem.AddTool(ToolBarItems.Add);
----
});
})
.Columns(col =>
{
col.Field("OrderID").HeaderText("OrderID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();
----
});
})
)
</div>
|