我是角色和javascript的新手。
我从(cellValueChanged)="enableCancelApplyButton($event)"
获得了真假值。
我想在enableCancelApplyButton($event)
函数中使用trashRowForDetailedEditFlowRules
获得的值。
我该怎么办?请帮忙
public trashRowForDetailedEditFlowRules(e: any) {
let rowIndex = e.rowIndex;
if (rowIndex == 1) {
this.showDetailCancelFlag = true;
this.showApplyButton = true;
}
}
private enableCancelApplyButton(flag: boolean) {
if (flag === true) {
this.showDetailCancelFlag = false;
this.showApplyButton = false;
}
}

<inline-edit-grid [gridParams]="editDetailGridParams" (cellValueChanged)="enableCancelApplyButton($event)" (rowClicked)="onDetailEditRowClicked($event)" (copyClicked)="onCopyClicked($event)" (trashClicked)="trashRowForDetailedEditFlowRules($event)" (editClicked)="editCellUpdate($event)"
class="grid-top session-grid" #editDetailGrid>
</inline-edit-grid>
&#13;
答案 0 :(得分:0)
答案 1 :(得分:0)
不确定这是更好的选择,但您可以轻松创建一个私有属性,您可以在其中传递值es:
private sharedBool: boolean = false;
public trashRowForDetailedEditFlowRules(e: any) {
//here you can access the sharedBool
let rowIndex = e.rowIndex;
if (rowIndex == 1) {
this.showDetailCancelFlag = true;
this.showApplyButton = true;
}
}
private enableCancelApplyButton(event) {
this.sharedBool = event;
if (event === true) {
this.showDetailCancelFlag = false;
this.showApplyButton = false;
}
}
希望它可以提供帮助