电话和你沟通后,确认你现在遇到的关键问题是无法在复选状态更改后,更新当前行样式,请参考下面的代码,在在线示例中加以修改即可
在overdue复选框状态改变后,会改变当前行2-4列的背景色和允许编辑状态
https://demo.grapecity.com.cn/wijmo/demos/Grid/Events/Editing/vue
- flexgrid.beginningEdit.addHandler((s, e) => {
- let col = s.columns[e.col];
- if (col.binding != "overdue"&&col.binding != "id") {
- let item = s.rows[e.row].dataItem;
- if (!item.overdue) {
- // prevent editing overdue items
- e.cancel = true;
- this.logText = "Overdue items cannot be edited";
- }
- }
- });
- flexgrid.cellEditEnding.addHandler((s, e) => {
- this.logText = "";
- let col = s.columns[e.col];
- let item = s.rows[e.row].dataItem;
- if (col.binding == "sales" || col.binding == "expenses") {
- }
- });
- flexgrid.formatItem.addHandler((s, e) => {
- if (e.panel == s.cells) {
- var col = s.columns[e.col], item = s.rows[e.row].dataItem;
- e.cell.style.backgroundColor="lightgray";
- if(col.binding != "overdue"&&col.binding != "id"){
- if(item.overdue){
- e.cell.style.backgroundColor="lightgreen";
- }
- }
- else if(col.binding != "overdue"){
- }
-
- }
- });
复制代码
|