Custom control for TabularForm

Hi there,

I’m seeking some guidance. Well, an example would be a benefit but I’m not (fully) expecting it.

Say I have a tabular form where, being a task my main model, I need to assign one or more roles for that task to a list of users. I could use checkboxes, one for each role, but then I’d need to return either the role_id or null to process and save form data. I haven’t found a way to do it.

Beside this, I’d like to have each role rendered as an inactive/unassigned (a one-character code over a grey background) or active/assigned box (the same code over a colored background), switching between states by clicking on it. I can render a static, not-editable list, but I also need an editable form.

How should I proceed? A custom widget, managing each role’s input box? Is there a way to customize an input checkbox to this? Or…?

Any help or suggestion, would be very appreciated.