|
actionBegin: function (args) {
if (args.requestType == "beforeAdd") {
let obj = (document.getElementById("GanttContainer") as any).ej2_instances[0];
let selectedRowIndex = obj.selectedRowIndex;
let isToolbar = (window as any).isToolbarClick;
// index is set based on position of newly added record
if ((!isToolbar && obj.contextMenuModule.item == "Above") || obj.editSettings.newRowPosition == 'Above') {
obj.query = new Query().addParams('index', selectedRowIndex.toString());
}
//...
},
[controller.cs]
public IActionResult BatchUpdate([FromBody] CRUDModel batchmodel)
{
int index = 0;
{
{
index = Int32.Parse((string)param.Value);
}
}
if (batchmodel.added != null)
{
for (var i = 0; i < batchmodel.added.Count(); i++)
{
DataList.Insert(index, batchmodel.added[i]);
}
}
//...
}
|