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
My component @wjfe/dataview uses a $derived to calculate the necessary information to lay out the component's data columns. This is great. Actually, the entire component is driven by just this one computation.
However, at work there is this need: In data drilling scenarios where "row expansion" shows another table that describes in more detail the expanded row's data (see this page for a live data-drilling example), users want that certain columns of the "child" table be visually synchronized in position and width with the equivalent parent table's column.
To achieve this, I have been thinking about this long and hard and I finally came up with a very effective way of achieving this cross-table column synchronization feature. It is actually functional in this REPL.
The problem: The calculation of the filler columns require setting state! Setting state while calculating a derived is currently forbidden. This forced the REPL to redefine colDefs as $state which is updated in an $effect. The terrible part of this is: My component would no longer be able to nicely server-render because effects don't run in SSR.
Describe the proposed solution
Somehow allow state mutation from a $derived?? I have no other idea except allowing it. If anyone has a better solution, I'll welcome it.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered:
Interesting. So the new unsafe() API function would allow me to mutate column.sync.expectedLeft inside a $derived, as I understood the PR. Yes, it is what I need!
Describe the problem
My component
@wjfe/dataview
uses a$derived
to calculate the necessary information to lay out the component's data columns. This is great. Actually, the entire component is driven by just this one computation.However, at work there is this need: In data drilling scenarios where "row expansion" shows another table that describes in more detail the expanded row's data (see this page for a live data-drilling example), users want that certain columns of the "child" table be visually synchronized in position and width with the equivalent parent table's column.
To achieve this, I have been thinking about this long and hard and I finally came up with a very effective way of achieving this cross-table column synchronization feature. It is actually functional in this REPL.
The problem: The calculation of the filler columns require setting state! Setting state while calculating a derived is currently forbidden. This forced the REPL to redefine
colDefs
as$state
which is updated in an$effect
. The terrible part of this is: My component would no longer be able to nicely server-render because effects don't run in SSR.Describe the proposed solution
Somehow allow state mutation from a $derived?? I have no other idea except allowing it. If anyone has a better solution, I'll welcome it.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: