Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

355
Views
How do I prevent filtering, sorting, or refreshing a tabulator table?

I have a tabulator table that users are able to edit.

When a user edits a table, I maintain the changes in a 'pending' state. They click a submit button, and the changes are persisted.

However, when the user sorts, filters, or refreshes the table it will clear their changes.

How can I warn the user about data loss when they perform a table refresh?

What I need is something simple like:

tabulator.subscribe("data-loading", () => !this.pendingChanges)

I tried making a module that did the above and checked if it worked with any of the data-* internal events, but it doesn't prevent refreshing the table, so I'm not sure if there's an event I can use to do this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The internal data-loading event is used to confirm whether a particular module has data available to load, by returning false you are telling Tabulator that your module has nothing to load, but that wont prevent other modules saying that they do have data available.

Also unless you are using remote sorting/filtering then those actions will not trigger a data refresh in the first place.

There are a few options if you are using ajax sorting/filtering:

Local Sorting/Filtering

Instead of using ajax sorting/filtering, load all data into the table and then let Tabulator do the sorting/filtering for you, this will then persist any edited values. This is the default behaviour of Tabulator

Save data as soon as edit is complete

I would suggest that you trigger the save back to the remote server as soon as the user has finished editing the cell, that way there is no risk of their sort causing issues.

If a user clicks off a cell that is being edited to sort or filter then it will be saved before the fitler/sort is triggered.

You can do this based on the 'cellEdited' event:

table.on("cellEdited", function(cell){
        //cell - cell component
});

Track Changes

another option would be to use the cellEdited event to track when changes to the table are made and then store that row data somewhere, in the event that that data is refreshed you could then reapply those changes.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!