Describe the bug
When I call row.update to update only a subset of data in a row, the mutators are called, but they are only passed the data that I am passing in the call to row.update rather than the data for the whole row.
In my mutator I refer to other data that I'm not changing. When the table is first created the mutator gets the full data for the row so this isn't a problem. The problem happens after I change the data with updateRow.
Tabulator Info
To Reproduce
Expected behavior
The mutator should change the value to "a2:A1"
Desktop (please complete the following information):
Additional info
I do still have a hook to the original raw data that I use to pass into Tabulator. If I know which row is being mutated I could easily get the full row from the original data. In fact, the field that I was looking up in the data passed to the mutator was the index (ID) precisely for this reason. Therefore if it was possible to get the index in the mutator (e.g. by passing the row component so that I can call row.getIndex(), this would solve the issue. However, I can't see a way to get the index from the data passed to the mutator. Please let me know if I'm missing something.
In my local fork of Tabulator, I've actually implemented a different work around, by passing a "mutate" flag to row.update(), similar to the flag passed to cell.setValue(). I then mutate the data first (at that point I know which row I'm changing) and pass the processed data directly to row.update. This fix works for me. However, I think it may be a little specific to my case so it may not be the best solution for everyone.
Hey @gillez
Thanks for the info, as it happens i actually notice this one myself while i was coding for the 4.2 update. It is a hangover from a simple time before all row data was passed into mutators.
I will look at improving this on the 4.3 release.
Cheers
Oli :)
Thanks Oli. Keep up the good work.
Whenever I change a value by using another field of data in a mutator function, currently I do search on a whole data of table to get the data of another field which doesn't exist in the data object passed to the mutator function.
It's bit tricky. I'm looking forward to new version being released soon.
Thanks for your great product.
Hey @gillez
I have just pushed an update to the 4.5 branch which ensures the full updated row data object is passed into the mutator.
This should be released in the next few weeks
Cheers
Oli :)
Most helpful comment
Whenever I change a value by using another field of data in a mutator function, currently I do search on a whole data of table to get the data of another field which doesn't exist in the data object passed to the mutator function.
It's bit tricky. I'm looking forward to new version being released soon.
Thanks for your great product.