Open eedwardsSGS opened 7 months ago
@eedwardsSGS this seems to work for me. The maxQty is based on the row that you are editing and has nothing to do with the filtered or unfiltered data. So I'm unable to understand the problem here. Please check whether the column type is correctly set to number for maxQty.
A support team member replicated it before I opened the ticket. Loom video: https://www.loom.com/share/58c88695fb9c4e53aaee88fb6eb87dbb?sid=a9c570f9-a89e-4470-8d29-4be43b557413
Table data: {{[{id: 10, maxQty: 1, qty: 0}, {id: 11, maxQty: 5, qty: 0}, {id: 20, maxQty: 4, qty: 0}, {id: 21, maxQty: 8, qty: 0}] }}
Correction to my max number, set in qty: {{currentRow.maxQty}}
Confirmed columns were correctly set to number.
@eedwardsSGS thanks for the video. This makes it clear
Is there an existing issue for this?
Description
When searching/filtering a table, items that use currentRow to determine their max or min value use the data from the unfiltered table instead of the filtered currentRow.
My use case is a table of quantities to prepare where the user inputs how many they have prepared, they should not be able to prepare more than the amount that is ordered, but when they filter the table to find a specific order, the data validation no longer works as expected.
Steps To Reproduce
Create a table
Populate it with 4 rows of data: ID | maxQty | Qty 10 | 1 | 0 11 | 5 | 0 20 | 4 | 0 21 | 8 | 0
Make qty editable and set the maximum valid amount to table.currentRow.maxQty
Search the table for "2", hiding the first two rows and moving the second two rows up to the first two.
Edit the quantity for ID 20 to be 1. This is valid. Edit it to be 2, this is not valid but should be.
Edit the quantity for ID 21 to be 4. This is valid. Edit it to be 7, this is not valid but should be.
Public Sample App
No response
Environment
Production
Issue video log
No response
Version
Self Hosted - 1.6.60