Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Modified items are not refelcting after submitting the data in react SPFX webpart

$
0
0

I am modifying the list items values in SPFX react webpart as shown in below after updating the data and submit the form i am not able to display the updated values of the list items. If i click on page refresh then only i can see the updated values.

Submit button code :

publicsubmitListItem():void{
pnp.sp.web.lists.getByTitle("APMDetails").items.getById(this.state.listItemId).update({
APMEMoreInfo:this.state.APMEMoreInfoData,
APMEReqAccess:this.state.APMEReqAccessData,
APMEGetTraining:this.state.APMEGetTrainingData,
APMELinkToAPP:this.state.APMELinkToAPPData,
APMESupport:this.state.APMESupportData,
APMESendCR:this.state.APMESendCRData
// Description:document.getElementById('txtDescription')["value"],
// RequestAccessLink:document.getElementById('txtreqAccessLink')["value"],
// SupportInfo:document.getElementById('txtSupportInfo')["value"],
// getTraining:document.getElementById('txtgetTraining')["value"],
// LinktoApplication:document.getElementById('txtLinktoApplication')["value"],
// HowtosendCR:document.getElementById('txtHowtosendCR')["value"],
// SupportLink:document.getElementById('txtSupportLink')["value"],
// Languages_x0020_Supported: { results: this.state.Languages}
});
this.getApplicationDetails();
this.componentDidMount();
myBoolean=true;
isEdit=false;
isPanel=true;
// document.getElementById('btnEdit').style.visibility = 'visible';
this.setState({
selectedKey:"tab0"
});
}

*************************************************************************************************

publiccomponentDidMount() {
this.getApplicationDetails();
}

privategetApplicationDetails():void
{
varreactHandler =this;
jquery.ajax({
url:`${this.props.siteUrl}/_api/web/lists/getbytitle('Details')/items?$filter=(Title eq '${currentPageName}')`,
type:"GET",
headers:{'Accept':'application/json; odata=verbose;'},
success:function(resultData) {
if(resultData.d.results.length>0){
reactHandler.setState({
items:resultData.d.results,
});
}
else{
}
},
error :function(jqXHR,textStatus, errorThrown) {
}
});
}

**************************************************************************************************


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>