You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello all, I wanted to discuss the possibility of converting/migrating the core Table block from static to dynamic type, and I am not sure whether this is possible, or at least discouraged.
There is a list of feature requests & enhancements for the Table block here - #32400
Recently, I picked up the feature request to merge/un-merge cells here - #15821
and made decent progress:
Screen.Recording.2023-09-12.at.1.45.54.AM.mov
This works pretty well until you save and reload. If you try to merge cells after reloading, it will break.
The reason is, when the HTML is saved to the DB, it excluded the cells that were part of the merged cell. Due to this, when the editor reconstructs the table using the save function, the original index values are lost.
I found it to be extremely complicated to fix it as the context of the table before and after saving is lost. And reconstruction passes values to the attributes after parsing the HTML of the saved data.
If we were to use a dynamic table, we could store this information as Block attributes and then use it to build the table server-side.
What is your proposed solution?
I have more of a concept at the moment rather than the actual solution. If this is feasible then I'll be more than willing to contribute to the discussion.
The text was updated successfully, but these errors were encountered:
Sidsector9
changed the title
Possibility of switching Table from static to dynamic block?Oct 5, 2023
What problem does this address?
Hello all, I wanted to discuss the possibility of converting/migrating the core Table block from static to dynamic type, and I am not sure whether this is possible, or at least discouraged.
There is a list of feature requests & enhancements for the Table block here - #32400
Recently, I picked up the feature request to merge/un-merge cells here - #15821
and made decent progress:
Screen.Recording.2023-09-12.at.1.45.54.AM.mov
This works pretty well until you save and reload. If you try to merge cells after reloading, it will break.
The reason is, when the HTML is saved to the DB, it excluded the cells that were part of the merged cell. Due to this, when the editor reconstructs the table using the
save
function, the original index values are lost.I found it to be extremely complicated to fix it as the context of the table before and after saving is lost. And reconstruction passes values to the attributes after parsing the HTML of the saved data.
If we were to use a dynamic table, we could store this information as Block attributes and then use it to build the table server-side.
What is your proposed solution?
I have more of a concept at the moment rather than the actual solution. If this is feasible then I'll be more than willing to contribute to the discussion.
The text was updated successfully, but these errors were encountered: