# Checkbox in Servoy DataGrid

**URL:** <https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971>\
**Category:** Classic Servoy\
**Created:** [May 6, 2019, 11:47am UTC](https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971 "2019-05-06T11:47:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev-ws-011](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@dev-ws-011](https://forum.servoy.com/u/dev-ws-011)\
**Post date:** [May 6, 2019, 11:47am UTC](https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971/1 "2019-05-06T11:47:38Z")

</div>

Hi,

I am working on NG Client and creating UI which is utilizing Servoy NG-Grids → DataGrid.

Foundset which is bound to DataGrid contains following fields of interest:

- Boolean(Check Box) (for selection)
- Text field (for description/detail of product)
- Date (for date of last stock updated)

I have successfully mapped text field and Date in DataGrid but cannot find a way to add Check Box as column in DataGrid. (In column ‘editType’ property, we can only select TextField, DatePicker, ComboBox or TypeAhead. No option for Check Box).

Any assistance in resolving above will be highly appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![paronne](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/paronne/32/5096_2.png) [@paronne](https://forum.servoy.com/u/paronne)\
**Post date:** [May 15, 2019, 12:31pm UTC](https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971/2 "2019-05-15T12:31:52Z")

</div>

Hi,

in the current version of the Data Grid there is not a check box editType indeed.  
Is possible to implement the check-box behavior using the styleClassDataprovider for your “check-box column”. The styleClassDataprovider will be a calculation returning a font-icon (e.g. Font Awesome icon).

For example let’s assume your foundset has a column ‘active’ and you want to show in the grid all records where the value active = 1

```auto
function isActiveStyleClass() { // calculation to be used as styleClassDataprovider
	return (active=== 1) ? 'fas fa-check-square' : 'fas fa-square';
}

```

You can then change the check foundset’s active value using the onCellClick event of the grid, toggling the active value from 0 to 1.

---

<div class="post-metadata">

**Author:** ![dev-ws-011](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@dev-ws-011](https://forum.servoy.com/u/dev-ws-011)\
**Post date:** [May 20, 2019, 10:39am UTC](https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971/3 "2019-05-20T10:39:25Z")

</div>

> paronne:  
> Hi,
> 
> in the current version of the Data Grid there is not a check box editType indeed.  
> Is possible to implement the check-box behavior using the styleClassDataprovider for your “check-box column”. The styleClassDataprovider will be a calculation returning a font-icon (e.g. Font Awesome icon).
> 
> For example let’s assume your foundset has a column ‘active’ and you want to show in the grid all records where the value active = 1
> 
> ```auto
> function isActiveStyleClass() { // calculation to be used as styleClassDataprovider
> 
> ```

```
return (active=== 1) ? 'fas fa-check-square' : 'fas fa-square';

```

}

> ```auto
> 
> You can then change the check foundset's active value using the onCellClick event of the grid, toggling the active value from 0 to 1.
> 
> ```

Thanks paronne for your help. I will try this and will update you. Hopefully it will work for me. ![:)]( "Smile")

---

<div class="post-metadata">

**Author:** ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)\
**Post date:** [October 12, 2019, 6:59am UTC](https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971/4 "2019-10-12T06:59:21Z")

</div>

Can anyone advise if there is a plan to add checkbox editType on datagrid? The styleClassDataprovider workaround works, but it would be much more efficient to have it as a default feature.

---

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [October 14, 2019, 2:32am UTC](https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971/5 "2019-10-14T02:32:45Z")

</div>

You would need to add that to the issue list on the component: [https://github.com/Servoy/aggridcomponents/issues](https://github.com/Servoy/aggridcomponents/issues)

I don’t currently see anything listed for a checkbox component on the agGrid

---

<div class="post-metadata">

**Author:** ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)\
**Post date:** [July 20, 2020, 2:58am UTC](https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971/6 "2020-07-20T02:58:53Z")

</div>

Any updates on having a CHECKBOX editType in AG Grids?  
I raised an issue [https://github.com/Servoy/aggridcomponents/issues/38](https://github.com/Servoy/aggridcomponents/issues/38)

---

<div class="post-metadata">

**Author:** ![sbutler](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sbutler/32/4393_2.png) [@sbutler](https://forum.servoy.com/u/sbutler)\
**Post date:** [July 20, 2020, 3:05am UTC](https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971/7 "2020-07-20T03:05:39Z")

</div>

I think there is just an image or css class workaround for now. So it just appears checked or unchecked.

---

<div class="post-metadata">

**Author:** ![antonio](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@antonio](https://forum.servoy.com/u/antonio)\
**Post date:** [July 20, 2020, 3:18am UTC](https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971/8 "2020-07-20T03:18:57Z")

</div>

yes, we’re using an onCellClick event to change the state of the boolean and a function that returns a font icon depending on its state.

```auto
return (active=== 1) ? 'fas fa-check-square' : 'fas fa-square';

```

Seems like a perfect use case for a new editType to handle all that.

---

<div class="post-metadata">

**Author:** ![sdevlin](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/sdevlin/32/4488_2.png) [@sdevlin](https://forum.servoy.com/u/sdevlin)\
**Post date:** [July 20, 2020, 1:35pm UTC](https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971/9 "2020-07-20T13:35:46Z")

</div>

Hi Antonio,

GoldCouger has the right approach. We just did a webinar with some UI tips & tricks for putting dynamic icons like that in the grid. You can watch it for examples.  
[https://servoy.com/webinars/tech-series/](https://servoy.com/webinars/tech-series/)

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [July 20, 2020, 1:48pm UTC](https://forum.servoy.com/t/checkbox-in-servoy-datagrid/19971/10 "2020-07-20T13:48:23Z")

</div>

Apart from that, checkbox support is on the list: [https://support.servoy.com/browse/SVY-14487](https://support.servoy.com/browse/SVY-14487)
