ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

ui-grid: Display checkbox instead of Boolean value without using custom cellTemplate

Open khpnguyen opened this issue 11 years ago • 6 comments

When I set a cell type to 'boolean' it would display True/False instead of a checkbox. When I click into the cell then a checkbox would appear for me to select/deselect to change the boolean value. However, I want the cell to alway display the checkbox instead of the boolean value. I know this can be done through a custom cellTemplate but would love to be able to achieve this without resolve to using one.

Is this possible? If not I would like to request this to be a feature. Maybe having some option like "renderCheckboxes: true" so that the cell would display the checkbox instead of True/False.

columnDefs: [{
           {
          name: 'D',
          field: 'display',
          allowCellFocus: true,
          type: 'boolean',
          headerCellClass: 'header_style',
          cellClass: 'name_style',
          enableCellEdit: true,
          enableHiding: false,
          enableColumnMenu: false,
          width: 35,
        }
}]

image

khpnguyen avatar Jun 26 '15 20:06 khpnguyen

This would be a good candidate for a small plugin. Someone could look at using https://github.com/c0bra/generator-ui-grid-plugin to make one.

c0bra avatar Jun 29 '15 14:06 c0bra

Hey Guy, I know it's a long time you did this question, but I found a solution.

I'm posting here because can help some one.

http://plnkr.co/edit/PL7HvK1FY2ycuOrBbBTA?p=preview

It's not my solution but it's works perfectly! Helped me a lot! x)

nathpaiva avatar Dec 02 '15 19:12 nathpaiva

Thanks @nathpaiva ! it was very helpful!^_^

samirakazemi avatar Mar 21 '16 18:03 samirakazemi

Hi @nathpaiva that solution uses a custom cellTemplate which is precisely what the Question is intending to avoid.

I wonder if this issue has been solved since then.

ReyHielo avatar Nov 29 '17 11:11 ReyHielo

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 23 '18 05:05 stale[bot]

This issue has been automatically closed because it has not had recent activity. If you believe that this is still an issue in the latest version, feel free to re-open it. Thank you for your contributions.

stale[bot] avatar Jun 22 '18 06:06 stale[bot]