Get Free Trial

trigger event when flat grid table column is sorted or filtered

Answered
amir asked on September 30, 2020

i have a flat data table with multiple columns. I want to user to save the table along with the filtering and sorting applied. i.e, user access the table apply some column filtering and sorting and then save the table. The save button is enabled only if user make some changes to table. I can get filtering changes event using reportchange event, but how can i get an event handler when user applies sorting.
I tried aftergriddraw. It triggers an event when the user applied sorting but it is also triggered when the page containing the table is loaded. So i cannot decide if user has made any changes as it is triggered when grid loads for the first time when user has not made any changes

6 answers

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster September 30, 2020

Hi Amir,
 
Thank you for posting your question.
 
We’ve managed to reproduce similar reportchange behavior on our side – the event is not triggered when sorting is changed in the flat grid layout.
 
Our team will take a deeper look at this and provide a fix with our upcoming release ETA Nov 2nd.
 
Please let us know if there is anything else we can help you with in the meantime.
 
Best regards,
Mykhailo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster November 3, 2020

Hi Amir,
 
We are glad to announce that the issue with the reportchange event not being triggered when changing sorting in flat form was fixed.
 
This is provided in the 2.8.19 version of Flexmonster: https://www.flexmonster.com/release-notes/
 
You are welcome to update the component: https://www.flexmonster.com/doc/updating-to-the-latest-version/
 
Please let us know if there is anything else we can help you with.
 
Best regards,
Mykhailo

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster November 10, 2020

Amir,
 
How are you?
 
Just checking in to ask whether you’ve received our notification regarding the latest Flexmonster version. Has it helped to fix the issue on your side?
 
We would be happy to hear your feedback.
 
Regards,
Mykhailo 

Public
Albert Ryan Banez December 17, 2020

Hi Amir,
I’m not sure if i have same issue.
But i want to trigger “Save” button when user hits the “Apply” button. apply button shows in difference places like for example user make some changes in the labels or filtering.
How can I trigger Save button?
Regards,
Albert

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster December 17, 2020

Hello, Albert,
 
Thank you for contacting us.
 
If we understand correctly, you require to save the report every time the configuration is changed (filtering, sorting, adding rows/columns).
 
We suggest checking out the reportchange event, which is triggered when a report is changed in the component.
Every time this event is triggered, execute the save method (“Save” button handler):

flexmonster.on("reportchange", () => {
  flexmonster.save();
})

 
Please let us know if it works for you.
Feel free to contact us in case further questions arise.
 
Kind regards,
Illia

Public
Albert Ryan Banez December 18, 2020

Hi Illia,
It works.
Thank you for the help.

Please login or Register to Submit Answer