[REACT] Grid view is not updating when records are updated
Posted: Tue Jul 06, 2021 11:28 am
by nikko.joson
Record name/display is not updated when the grid records are updated. I even added a console log on the .add() but the grid display and console log does not update and console log for formatting the name is not re-called.
how can i implement a refresh for each record updated or like resumerefresh() to refresh the grid.
Re: [REACT] Grid view is not updating when records are updated
Posted: Tue Jul 06, 2021 11:32 am
by mats
Sounds like you have not defined your Model correctly, did you add fields? Please provide code and we'll help you find the error.
Re: [REACT] Grid view is not updating when records are updated
Posted: Tue Jul 06, 2021 11:34 am
by nikko.joson
here is the model im using for the store for my grid.
Re: [REACT] Grid view is not updating when records are updated
Posted: Tue Jul 06, 2021 11:35 am
by nikko.joson
class Task extends EventModel {
static get defaults() {
return {
// in this demo, default duration for tasks will be hours (instead of days)
durationUnit : 'h'
};
}
}
this is the Task model
Re: [REACT] Grid view is not updating when records are updated
Re: [REACT] Grid view is not updating when records are updated
Posted: Tue Jul 06, 2021 11:58 am
by mats
Still not seeing full picture. The store you use for the grid needs to have ”modelClass” set to a model which defines the fields you want to show / edit
Re: [REACT] Grid view is not updating when records are updated
Posted: Tue Jul 06, 2021 12:03 pm
by nikko.joson
@mats my 2nd code snippet is my model, that's the only content i have, now i added this for the name field, but still the same result
Re: [REACT] Grid view is not updating when records are updated
Posted: Tue Jul 06, 2021 3:17 pm
by Maxim Gorkovsky
Hello.
I'm afraid code snippets you are posting here do not paint full picture. I see you declared TaskStore and Task model here. I can only assume you instantiate correct store when you pass it to the Grid, smth like:
new Pooltech({
store : new TaskStore({...})
})
So far it seems that you do not use the store instance. Please add missing code here.