KeyValue

Is it possible to make the KeyValue field to make the key auto incrementing? (when it's disabled)
7 Replies
LeandroFerreira
Could you explain more about it?
Sector
Sector3w ago
Sure. I want to create a KeyValue column, where I hit the "Add row" button, the Key value goes up by 1. ( and it's dislabled ), so in this case, a new row is added, where the default key is 52.
No description
Sector
Sector3w ago
Also, I can hide somehow the a Keys?
Lara Zeus
Lara Zeus3w ago
you could customize the create action and set the input to incremented value! https://filamentphp.com/docs/3.x/forms/fields/key-value#customizing-the-key-value-action-objects
Sector
Sector3w ago
and with this, how can i access the current and the previous row?
Lara Zeus
Lara Zeus3w ago
not sure, but you can add a prop counter and then you can $this-counter++ on creating and $this->counter-- on delete
Sector
Sector3w ago
i dont think i can access the values with this :S maybe i will use a mutator or something, i dont have better idea.
Want results from more Discord servers?
Add your server