Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
149844 | Dec 11,2019 12:52 PM UTC | Dec 11,2019 01:44 PM UTC | ASP.NET Core - EJ 2 | 1 |
![]() |
Tags: DataGrid |
Hi is there a way where each row is dependent on the previous row's value for example if the status is COMPLETED only then the next row will be editable.
Example here if status value is COMPLETED the next row should be open for editing. Thanks I appreciate it.
<e-grid-column field="clientName" isIdentity="true" headerText="Client" width="125"></e-grid-column>
<e-grid-column field="name" isIdentity="true" headerText="Name" width="75"></e-grid-column>
<e-grid-column field="description" isIdentity="true" headerText="Description" width="120"></e-grid-column>
<e-grid-column field="startDate" headerText="Start Date" editType="datetimepickeredit" width="75"></e-grid-column>
<e-grid-column field="endDate" headerText="End Date" editType="datetimepickeredit" width="75"></e-grid-column>
<e-grid-column field="status" headerText="Status" foreignKeyField="Status" foreignKeyValue="Name" dataSource="@ViewBag.status" editType="dropdownedit" edit="@(new {@params=ddlStatus })" width="75"></e-grid-column>
<e-grid-column field="employeeId" headerText="Assigned" foreignKeyField="EmployeeId" foreignKeyValue="Name" dataSource="@ViewBag.employees" editType="dropdownedit" edit="@(new {@params=ddlEmployee })" width="75"></e-grid-column>
function actionBegin(args) {
if (args.requestType === "beginEdit") {
var prevRec = this.columns[1].dataSource.dataSource.json.find((e)=>e['EmployeeID'] ===this.getCurrentViewRecords()[args.rowIndex - 1]["EmployeeID"])["FirstName"]
if (prevRec == "Paul") {
args.cancel = true;
}
}
}
<ejs-grid id="Grid" dataSource="@ViewBag.datasource" actionBegin="actionBegin" >
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="120"></e-grid-column>
<e-grid-column field="EmployeeID" headerText="Empolyee Name" foreignKeyValue="FirstName" dataSource="ViewBag.foreign" width="150"></e-grid-column>
. . .
. . .
</e-grid-columns>
</ejs-grid> |
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.