livewire-datatables icon indicating copy to clipboard operation
livewire-datatables copied to clipboard

Editable Boolean

Open mgalante1 opened this issue 3 years ago • 2 comments

I have a Boolean column in my datatable showing a check mark or an 'x' based on the value in the database. I was wondering if there was a way to edit this so that if I were to click on either the check mark or x, then the value in the database would change.

When I add the editable() attribute, the column just shows a 1 or nothing at all and I have to manually type the value that I would like to change it to.

mgalante1 avatar Dec 22 '21 15:12 mgalante1

Nevermind, I was able to accomplish this by using the boolean.blade.php file as a template on a callback function.

mgalante1 avatar Dec 22 '21 16:12 mgalante1

Nevermind, I was able to accomplish this by using the boolean.blade.php file as a template on a callback function.

May I know the sample code to accomplish this ? Cuz I tried both the callback function and the view function but still cannot make it right :(

key60529 avatar Nov 24 '22 15:11 key60529