Table, access previous or another record data
Is it possible to access the previous record in a table? or the first one? From a record you can access the data of another.
6 Replies
Can you clarify more what do you mean with a
previous records
and where you are trying to access it?I need the value of the column of the previous row and first row. And If I filter table or sort update with new values.
Sir, you still didn't clarify what do you mean with the
previous row
how many rows in the table page and in the previous page as well.table has only one page and what I want is data from a column in the previous row. For example, in row id 34, I want the data from column 1 of row id 33 and from column 2 of row id 1.
Oh, I do not think Filament is supporting something like that direclty
You'd want to do this within your model, something like this:
If you're using mysql 8 (or postgres) you can also look at the window functions, and probably just join them directly. The functions are
LEAD()
and LAG()
.