this is the code missing
function gridActionComplete(args) {
if (args.requestType == "batchsave" && args.target != undefined) {
firstSelection = true;
if (args.target.id == "ProductsGrid") {
var allocatedGridObj = $("#AProductsGrid").data("ejGrid");
allocatedGridObj.refreshContent();
} else if (args.target.id == "AProductsGrid") {
//Select all records
if (this._gridRecordsCount > 0) {
this.selectRows(0, this._gridRecordsCount - 1);
this.batchChanges.changed = new Array();
}
var GridObj = $("#ProductsGrid").data("ejGrid");
GridObj.refreshContent();
}
var idPortfolioProduct = $("#ddPortfolioProducts").val();
$.getJSON("/PortfolioProducts/GetPortfolioProductAmounts?IdPortflioProduct=" + idPortfolioProduct, function (result) {
$("#productAmountTB").ejNumericTextbox({ value: result.PortfolioProductAmount });
$("#pendingAmountTB").ejNumericTextbox({ value: result.PendingAmount });
$("#allocatedAmountTB").ejNumericTextbox({ value: result.AllocatedAmount });
});
}
if (args.requestType == "refresh" && args.target != undefined && args.target.id == "AProductsGrid") {
//Select all records
if (this._gridRecordsCount > 0) {
this.selectRows(0, this._gridRecordsCount - 1);
this.batchChanges.changed = new Array();
}
//Display portfolio amounts
var idPortfolioProduct = $("#ddPortfolioProducts").val();
$.getJSON("/PortfolioProducts/GetPortfolioProductAmounts?IdPortflioProduct=" + idPortfolioProduct, function (result) {
$("#productAmountTB").ejNumericTextbox({ value: result.PortfolioProductAmount });
$("#pendingAmountTB").ejNumericTextbox({ value: result.PendingAmount });
$("#allocatedAmountTB").ejNumericTextbox({ value: result.AllocatedAmount });
});
}
if (args.requestType == "refresh" && args.target != undefined && args.target.id == "ProductsGrid") {
if (this._gridRecordsCount > 0) {
this.batchChanges.changed = new Array();
for (var i = 0; i < this._currentJsonData.length; i++) {
if (this._currentJsonData[i].Allocate == true) {
this.selectRows(i);
this.multiSelectCtrlRequest = true;
this.batchChanges.changed.push(this._currentJsonData[i]);
if (!this.changed) {
this.changed = true;
}
}
}
}
}
}
| [Index.cshtml] <ej-grid id="ProductsGrid" allow-paging="true" datasource="ViewBag.dataSource"> <e-columns> <e-column field="Verified" type="checkbox" header-text="Select"></e-column> <e-column field="OrderID" header-text="Id Product" text-align="Left" is-primary-key="true"></e-column> --- <e-column field="Verified" header-text="Allocate" type="string" ></e-column> </e-columns> </ej-grid> |