Checkbox in Servoy DataGrid

Forum to discuss the new web client version of Servoy.

Checkbox in Servoy DataGrid

Postby dev-ws-011 » Mon May 06, 2019 1:47 pm

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
Servoy Developer
dev-ws-011
 
Posts: 73
Joined: Fri Oct 21, 2016 8:23 am

Re: Checkbox in Servoy DataGrid

Postby paronne » Wed May 15, 2019 2:31 pm

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

Code: Select all
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.
paronne
 
Posts: 202
Joined: Fri Nov 02, 2012 3:21 pm

Re: Checkbox in Servoy DataGrid

Postby dev-ws-011 » Mon May 20, 2019 12:39 pm

paronne wrote: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

Code: Select all
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.


Thanks paronne for your help. I will try this and will update you. Hopefully it will work for me. :)
Servoy Developer
dev-ws-011
 
Posts: 73
Joined: Fri Oct 21, 2016 8:23 am

Re: Checkbox in Servoy DataGrid

Postby antonio » Sat Oct 12, 2019 8:59 am

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.
Tony
Servoy 8 - 2022.03 LTS
antonio
 
Posts: 638
Joined: Sun Apr 02, 2006 2:14 am
Location: Australia

Re: Checkbox in Servoy DataGrid

Postby sbutler » Mon Oct 14, 2019 4:32 am

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

I don't currently see anything listed for a checkbox component on the agGrid
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Checkbox in Servoy DataGrid

Postby antonio » Mon Jul 20, 2020 4:58 am

Any updates on having a CHECKBOX editType in AG Grids?
I raised an issue https://github.com/Servoy/aggridcomponents/issues/38
Tony
Servoy 8 - 2022.03 LTS
antonio
 
Posts: 638
Joined: Sun Apr 02, 2006 2:14 am
Location: Australia

Re: Checkbox in Servoy DataGrid

Postby sbutler » Mon Jul 20, 2020 5:05 am

I think there is just an image or css class workaround for now. So it just appears checked or unchecked.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
sbutler
Servoy Expert
 
Posts: 759
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Checkbox in Servoy DataGrid

Postby antonio » Mon Jul 20, 2020 5:18 am

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.

Code: Select all
return (active=== 1) ? 'fas fa-check-square' : 'fas fa-square';


Seems like a perfect use case for a new editType to handle all that.
Tony
Servoy 8 - 2022.03 LTS
antonio
 
Posts: 638
Joined: Sun Apr 02, 2006 2:14 am
Location: Australia

Re: Checkbox in Servoy DataGrid

Postby sean » Mon Jul 20, 2020 3:35 pm

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/
Software Engineer
Servoy USA
sean
 
Posts: 370
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: Checkbox in Servoy DataGrid

Postby patrick » Mon Jul 20, 2020 3:48 pm

Apart from that, checkbox support is on the list: https://support.servoy.com/browse/SVY-14487
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 4 guests

cron