JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Scheduler › Update date from server do not refresh the data
Tagged: datasource refreshdata
- This topic has 4 replies, 3 voices, and was last updated 1 year, 5 months ago by
Andrea Durando.
-
AuthorPosts
-
March 2, 2023 at 9:50 am #104453
Andrea Durando
ParticipantHi all,
I have an issue about the CRUD operation for the events .
When the user do a CRUD operation i’ll send an API request and after the ok e redo a search to abtainthe list of calendar event updated.
To update the datasource a copied parto of the code prsent the example
https://www.htmlelements.com/angular/demos/scheduler/server-side-crud/Here the part of the code that i use tu update it :
//response is the list of elements that i save in a locla varaible this.listEvents
<div>
<div> this.listEvents = response.body??[];</div>
</div>
<div>//After do that i update the datasource</div>
<div></div>
<div>
<div>
<div>this.scheduler.dataSource = new window.Smart.DataAdapter({</div>
<div> dataSource: this.listEvents ,</div>
<div> dataSourceType: ‘array’,</div>
<div> dataFields: [</div>
<div> { name: ‘id’, map: “id”, dataType: ‘string’ },</div>
<div> { name: ‘label’, map: “description”, dataType: ‘string’ },</div>
<div> { name: ‘dateStart’, map: ‘start_date’, dataType: ‘string’ },</div>
<div> { name: ‘dateEnd’, map: ‘end_date’, dataType: ‘string’ },</div>
<div> { name: ‘description’, map: ‘description’, dataType: ‘string’ }</div>
<div> ]</div>
<div> });</div>
</div>
</div>
<div></div>
<div>I noticed that that work not always sometimes it update the data and sometime not.</div>
<div>What could be the cause?</div>
<div></div>March 3, 2023 at 12:46 pm #104459Markov
KeymasterHi Andrea,
I’d suggest you to check whether this is cache related. I would also suggest you to console.log the this.listEvents as it could be also Async related i.e you set the dataSource to the old value, not to the new value.
March 6, 2023 at 12:05 pm #104482Andrea Durando
ParticipantHi i do a check for the cache but seems not a problema about it,
and I try to pass directly the response from the API to the dataSource, but the problem still remain.
Any other suggestion?
March 7, 2023 at 8:09 am #104490svetoslav_borislavov
ParticipantHi,
Can you please share your code, so that we can work on it?
You may send it here but the preferred way is to send it to support@jqwidgets.comBest Regards,
Svetoslav BorislavovSmart UI Team
https://www.htmlelements.com/March 8, 2023 at 7:41 am #104493Andrea Durando
ParticipantYestarday I forward to you an E-Mail with the code that i wrote.
Regards
Andrea
-
AuthorPosts
- You must be logged in to reply to this topic.