-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide display options for columnType #34
Comments
Love working with the system by the way much easier to use than tanstack tables. Especially for working with simple row data. |
Hi @jeffreygaggino. The I don't think I fully understand the problem that you are describing, could you elaborate on how does it make it difficult to send data to the server? Or could you perhaps illustrate the step by step process that is causing the difficulty. Thanks! |
Front end wise I want to show 12% to the user. At least from my understanding with using the table it seems like I've got to change the actual data to "12%". I would rather want to keep the data to be 0.12 and show to the user "12%". So have a function that doesn't mutate the original value of 0.12 but allows regex / text transformations to display 0.12 as "12%". When they edit it reverts back to the "real" value of 0.12 |
Hey @jeffreygaggino. Active Table's internal code has been built to only work with actual values from the table cells, hence it is unable to handle pseudo data. For your case, you will unfortunately have to either maintain some sort of an alternative table in your app's state with the help of In regards to the two images above, I can see the value is turned into a percentage - except the percentage is processed incorrectly. You will need to upgrade the
This code can be further enhanced for better percentage processing. |
Hi, From what I understand changeTextFunc is only called when the cell value actually changes. Exposing "cell-focus" and "cell-blur" events might allow two way conversion. |
Currently when you want to display a "$" sign or "%" you've got to change the raw data:
So for example 0.12 should show as 12%. However to get it working you need to change the actual value to 12%. This is bad when when you have to send it back to a server.
Recommendation for a "changeDisplayFunc" function. It would happen after changeTextFunc (for example cleaning data to only display numbers). In the example 0.12:
The text was updated successfully, but these errors were encountered: