Page 1 of 1

[REACT] Ui Not Updated When There is active filter

Posted: Thu Apr 17, 2025 11:13 am
by tjmeal

Dear all,

I hope this ticket finds you well.

I am facing a weird problem which i dont why it happens.

If you check my video attached > when the search field is utilised the UI not get updated.

What is on the video>

1) Make multiple updates on driver column (which changes also the status column) > and the UI works perfectly
2) The moment i filter the grid using the search field > the up is not get updated
3) If i click X button on search bar and remove the filter > and all the records are visible again > the UI is updated and shows the corrects values.

Before we start to dig deeper, I would like to ask if have you faced any similar behaviour with any other project?


Re: [REACT] Ui Not Updated When There is active filter

Posted: Thu Apr 17, 2025 1:39 pm
by ghulam.ghous

So what you need is to re-apply the filters whenever a record is updated. We have a config for that: https://bryntum.com/products/grid/docs/api/Core/data/Store#config-reapplyFilterOnUpdate

Please set it to true on the store:

new Grid({
      store: {
             reapplyFilterOnUpdate : true
      }
})

Re: [REACT] Ui Not Updated When There is active filter

Posted: Thu Apr 17, 2025 8:11 pm
by tjmeal

Hello,

Thanks for your reply but the issue on the video attached seems to be resolved with "reapplyFilterOnAdd: true" is that normal ?

Also, i have a field startDate > how can i sort the grid by startDate and lock it (so the user won't be able to remove the sort) ?

I have configure the store like bellow

  store: {
    data: [],
    modelClass: GridMyModel,
    autoCommit: false,

reapplyFilterOnAdd: true,
reapplySortersOnAdd: {
  fields:["startDate"]
},

reapplyFilterOnUpdate: false,
reapplySortersOnUpdate: {
  fields:["startDate"]
},
sorters: [
  {field: "startDate", ascending: true},
]
  },

Re: [REACT] Ui Not Updated When There is active filter

Posted: Thu Apr 17, 2025 11:15 pm
by mats

Thanks for your reply but the issue on the video attached seems to be resolved with "reapplyFilterOnAdd: true" is that normal ?

Yes if you don't set this to true, new records will be filtered out unless they match your filter.

Also, i have a field startDate > how can i sort the grid by startDate and lock it (so the user won't be able to remove the sort) ?

Please never post multiple questions in one thread.


Re: [REACT] Ui Not Updated When There is active filter

Posted: Fri Apr 18, 2025 10:36 am
by tjmeal

Okay,

Thank you very much !!