rappasoft / laravel-livewire-tables

A dynamic table component for Laravel Livewire
https://rappasoft.com/docs/laravel-livewire-tables/v2/introduction
MIT License
1.71k stars 320 forks source link

[Feature Request]: Add a hideValueIf option for Column. #1435

Closed amshehzad closed 8 months ago

amshehzad commented 9 months ago

Overview

I think it'll be nice to pass the current row to hideIf so we can hide the column based on the row value e.g if a row is created_by admin, hide it

Detailed explanation

No response

Notes

No response

lrljoe commented 9 months ago

as discussed, suggest a hideValueIf approach

lrljoe commented 8 months ago

Assigned to @amshehzad initially, but can review

lrljoe commented 8 months ago

Should add the method hideValueIf() with a callback:

hideValueIf(callback $callback)

The end code should add the usual functions has/get/set for the hideValueIf

If the hideValueIf callback returns false, the value should be returned If the hideValueIf callback returns true, the value should not be returned

This should not use classes to hide the content, but actually remove the content, and return an empty