Datagrid2 with a checkbox with default value checked

0
Hello, I am using datagrid2 for displaying the list of entries. I have enabled selection of each row using the checkbox method. Now I want to enable the checkbox of few entries in the list when the page is initially loaded. How can I achieve this?     Enable these checkboxes on page load based on some conditions:   I also know that it is possible to construct the list items with checkboxes but in my case, I have of 1000 of entries which would impact the performance and thats why I would like to use inbuild checkboxes but few checkboxes enabled by default on page load..     Regards. 
asked
2 answers
1

As far as i know, there is a no way to configure defaults check in datagrid2.

If you want to configure default check. I strongly recommends using non-persistalbe entity.

First create an entity that holds info of check status;

image.png

Second, Make a association between Persistable Object ans non persistable object

image.png

Third, Make a column that show checkbox. You can leave caption blank. And Set the attribute what you want.

image.png

image.png

Fourth, add a dataview that retrieve Checkbox non persistable entity.

image.png

image.png

then walla!

image.png

if i want to check even number row then,

image.png

then,

image.png

 

if you need a checkbox toggle button then,

Create Entity that stores the Entity that placed in data grid 2

image.png

And Place a dataview that return that entity that contains boolean attribute, Add datagrid 2 to dataview and place a checkbox widget to 'Place filter widget'

image.png

Don't forget to make a association with Infomation entity and Root Entity!

 

And give a on click event to checkbox

image.png

 

Walla!

Screenshot 2023-11-23 at 14.39.07.gif

 

Or, modify the datagrid 2. You can modify the data grid2. Its source code is on Github. Download it and modify the codes as pluggable widgets.

But I don't recommend to modify the codes. I tried that and results are... nahh  

answered
0

Hey

 

You can write the logic before opening/redirecting to the page in a microflow

You can state your conditions in the retrieve xpath, set the boolean value for those objects as true and then give the open page activity.

Hope this helps!

 

Regards

answered