KeyValue
Is it possible to make the KeyValue field to make the key auto incrementing? (when it's disabled)
7 Replies
Could you explain more about it?
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.
Also, I can hide somehow the a Keys?
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
and with this, how can i access the current and the previous row?
not sure, but you can add a prop
counter
and then you can $this-counter++
on creating and $this->counter--
on deletei dont think i can access the values with this :S
maybe i will use a mutator or something, i dont have better idea.