2017-11-22 8 views
0

私は角度とJavaScriptに新しいです。

私はこの(cellValueChanged)="enableCancelApplyButton($event)"から真偽値を得ています。

私はenableCancelApplyButton($event)から得た値をtrashRowForDetailedEditFlowRulesに使用したいと思います。

どうすればいいですか? enableCancelApplyButton内部だけで推測コール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>

+0

を助けることを願って、あなたがそれを使用したいです?あなたは '(cellValueChanged)'でそれを呼び出す必要がありますか? –

答えて

0

を助け、trashRowForDetailedEditFlowRules(E)への引数として$イベントを渡してください。

0

それは良い選択ですが、あなたはeasylyあなたが値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; 
    } 
} 

は、それがどのように

関連する問題