table.clearChangeset is not a function

There are two table components that i am using
The outer table -> marketPlaceTable
The innter table -> productTable
Data for these two tables are coming from different temporary variables
Outer table has 'expand rows on selection" setting on.
When a row in the outer table is clicked, i apply a filter on the inner table to show only the relevant rows from inner table

What I am doing (successfully)

  • On any cell edit in the inner table, run a javascript query that will do some complex calculations and update columns of other rows in the innerTable. Then it will call innterTable.clearChangeset() function at the end.

This is working fine and image 2 shows how the innerTable state looks when i expand say 3-4 groups and make edits to any one or more groups of innerTable

Issue

  • When i use the search functionality to filter (outerTable) to a particular group and change any row value -> it works as expected. Below is the image for change event handler in the search input box. It applies a filter on the outer table.


    This is how the state looks

  • Then when i search a different value and change any row value -> I get the error saying, innerTable.clearChangeset is not a function.
    When i put the debugger and investigate further, I can see that changeSetArray is defined (containing the changed values) but there is no function called clearChangedSet as before
    This is how the state looks

Sry for too many images, but i wasn't sure how else to communicate my issue
I have been at it for few hours and I am not sure what's the issue
Please let me know if any other information is needed

I hope my question was clear.
Please let me know if any additional details are needed, not able to proceed forward with my work because of this

Can you share how are you calling the innerTable.clearChangeset()

Hi,
I found that the issue was coming from the search filter at the top.
Initially the search filter was configured to filter only the outer table marketPlaceTable.
There was no need to add the filter to the inner table also as it would have no affect (atleast visually).
But when I added the filter to the inner table (productTable) also, the problem i mentioned seemed to have gone away.

My takeway from all this was ->
If applying filters on the outer table, apply the same filers to the inner table as well irrespective of whether they seem redundant or not.

This seemed to have solved the issue