# headerCheckboxSelection Server Side?

**URL:** <https://forum.servoy.com/t/headercheckboxselection-server-side/20744>\
**Category:** Questions\
**Created:** [April 21, 2022, 11:46pm UTC](https://forum.servoy.com/t/headercheckboxselection-server-side/20744 "2022-04-21T23:46:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![john1598360627](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@john1598360627](https://forum.servoy.com/u/john1598360627)\
**Post date:** [April 21, 2022, 11:46pm UTC](https://forum.servoy.com/t/headercheckboxselection-server-side/20744/1 "2022-04-21T23:46:08Z")

</div>

I added the column definition of ‘headerCheckboxSelection’ to an NG Grid column. This enables a checkbox that lets you select all the records filtered within the foundset.

However, I encountered this error message.

```auto
WARN org.sablo.BrowserConsole - headerCheckboxSelection is not supported for Server Side Row Model

```

I’m not sure what this means. Is it because the NG client is server-side? Is there no way of implementing a header checkbox?

[https://www.ag-grid.com/javascript-data … -selection](https://www.ag-grid.com/javascript-data-grid/row-selection/#header-checkbox-selection)

---

<div class="post-metadata">

**Author:** ![john1598360627](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@john1598360627](https://forum.servoy.com/u/john1598360627)\
**Post date:** [April 28, 2022, 11:15pm UTC](https://forum.servoy.com/t/headercheckboxselection-server-side/20744/2 "2022-04-28T23:15:30Z")

</div>

If _headerCheckboxSelection_ isn’t available within Servoy at this time, is there anyway of doing a ‘onHeader’ click event from the grid? Such that I can re-invent the headerCheckboxSelection behavior with it.

There is a ‘onFooterClick’ event for the grid so, is there one for Header?

---

<div class="post-metadata">

**Author:** ![Gabi\_Boros](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@Gabi\_Boros](https://forum.servoy.com/u/Gabi_Boros)\
**Post date:** [April 29, 2022, 9:09am UTC](https://forum.servoy.com/t/headercheckboxselection-server-side/20744/3 "2022-04-29T09:09:45Z")

</div>

‘headerCheckboxSelection is not supported for Server Side Row Model’ because in this mode, that is used in Data grid,  
not all rows are loaded/displayed in the component at once, they are loaded in ‘chunks’ of rows, and so, a ‘select all’ in the header make no sense - as not all rows are displayed.  
The Data grid (ag grid) does not directly supports header click events, as they are ‘reserved’ to sorting - so if you really want to add some code for header clicks, you need to use the onSort callback.  
But, if you want to have a ‘select all’ in the header, I suspect you have a grid where you want to load a ‘limited’ number of rows, as you want to displayed them all at once, so maybe a better fit would be the Power grid, that uses a Client Side Row Model, and so it also supports ‘headerCheckboxSelection’

---

<div class="post-metadata">

**Author:** ![john1598360627](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@john1598360627](https://forum.servoy.com/u/john1598360627)\
**Post date:** [April 29, 2022, 10:52pm UTC](https://forum.servoy.com/t/headercheckboxselection-server-side/20744/4 "2022-04-29T22:52:10Z")

</div>

> Gabi Boros:  
> ‘headerCheckboxSelection is not supported for Server Side Row Model’ because in this mode, that is used in Data grid,  
> not all rows are loaded/displayed in the component at once, they are loaded in ‘chunks’ of rows, and so, a ‘select all’ in the header make no sense - as not all rows are displayed.  
> The Data grid (ag grid) does not directly supports header click events, as they are ‘reserved’ to sorting - so if you really want to add some code for header clicks, you need to use the onSort callback.  
> But, if you want to have a ‘select all’ in the header, I suspect you have a grid where you want to load a ‘limited’ number of rows, as you want to displayed them all at once, so maybe a better fit would be the Power grid, that uses a Client Side Row Model, and so it also supports ‘headerCheckboxSelection’

Ohhh I see. Data grid loading in chunks, while Power grid loads everything.

I haven’t used the Power grid before so I don’t know how to convert the foundset into the dataset so the Power grid can grab the data. I’ll need to figure that out and try it out. Thanks!

---

<div class="post-metadata">

**Author:** ![steve1376656734](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/steve1376656734/32/4613_2.png) [@steve1376656734](https://forum.servoy.com/u/steve1376656734)\
**Post date:** [May 11, 2022, 10:38am UTC](https://forum.servoy.com/t/headercheckboxselection-server-side/20744/5 "2022-05-11T10:38:19Z")

</div>

Hi,

Converting the foundset to a dataset is as simple as calling databaseManager.convertToDataSet(foundset).

You can give a second, optional argument that is an array of data provider names if you only want to include some of the DB fields in the conversion.

Hope this helps  
Steve

---

<div class="post-metadata">

**Author:** ![john1598360627](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@john1598360627](https://forum.servoy.com/u/john1598360627)\
**Post date:** [May 14, 2022, 1:07am UTC](https://forum.servoy.com/t/headercheckboxselection-server-side/20744/6 "2022-05-14T01:07:46Z")

</div>

> steve1376656734:  
> Hi,
> 
> Converting the foundset to a dataset is as simple as calling databaseManager.convertToDataSet(foundset).
> 
> You can give a second, optional argument that is an array of data provider names if you only want to include some of the DB fields in the conversion.
> 
> Hope this helps  
> Steve

Hmmm. But, after the conversion how does the grid update the data? I’m probably misunderstanding, but I thought the idea was that since you’re converting it from Server to Client, the dataset is static.

Is there a way of still updating the dataset whenever there’s a change to the database?

---

<div class="post-metadata">

**Author:** ![steve1376656734](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/steve1376656734/32/4613_2.png) [@steve1376656734](https://forum.servoy.com/u/steve1376656734)\
**Post date:** [May 14, 2022, 1:04pm UTC](https://forum.servoy.com/t/headercheckboxselection-server-side/20744/7 "2022-05-14T13:04:11Z")

</div>

Unfortunately you need to refresh the grid manually whenever the data changes. It’s meant for manipulating a set of data that is predetermined, you can refresh it but only manually.

Steve

---

<div class="post-metadata">

**Author:** ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)\
**Post date:** [May 14, 2022, 1:39pm UTC](https://forum.servoy.com/t/headercheckboxselection-server-side/20744/8 "2022-05-14T13:39:53Z")

</div>

Hi John,

what is the usecase?

So far the messages have been about something you want, but isn’t possible.  
In order to think about a solution for your problem, it would be nice to know what context this is in.

Maybe screenshot, what is the possible foundset size, etc. etc.
