Using wire decorator I am calling Apex method on load of the page. Same wired method I want to call on reset button. I have a requirement on click of reset button Page should show ONLOAD data and reset all the selection in lightning combo box. following is the HTML and JS part of my component. HTML
<lightning-button-icon icon-name="utility:refresh" alternative-text="Reset"
class="slds-p-around_xx-small" onclick={refreshTable}>
</lightning-button-icon>
JS
@track selectedyear;
@track selectedmonth;
@wire(fetchAccdata, {year : '$selectedyear', month :'$selectedmonth'})
AccountData({error,data}){
if(data){
this._accwisedata=data;
}
else if(error){
console.error('Error:\n',error);
}
}
refreshTable(event){
this.selectedacc = null;
this.Name= null;
this.selectedmonth=this._data.currentMon;
this.selectedyear=this._data.currentYr;
this.AccountData();// I have tried this and following refereshApex option.
//refreshApex(AccountData);
console.log('I am in Reset Table EVENTTTTTTTTTTTTTTTTTTTTTTT');
}