rstaib / jquery-bootgrid

Nice, sleek and intuitive. A grid control especially designed for bootstrap.
http://www.jquery-bootgrid.com
MIT License
973 stars 364 forks source link

Conditional formatter #402

Open Bliksempie opened 6 years ago

Bliksempie commented 6 years ago

Hi,

I posted twice on Stackoverflow with no response, so I am wondering if this is possible:

Let's say a user is locked (a flag set in my PHP data), I then want the formatter to be "unlock" which will then do something I specify in a PHP function (i.e., unlock the user), but if the user is not locked, I want the formatter to be "lock" which will lock the user.

So - I can where I build my actions do a loop through the data, but it does not make the feature re-usable. Is there a better/easier way to do it?

Bliksempie commented 6 years ago

For now, I had to do a very ugly hack by writing raw JS code within the PHP loop that generates the formatters for me. It works, but is not very elegant...