How to Interact with a Datagrid object by clicking a button outside the Datagrid?

1
I have a Datagrid on the page. After I select an item in the grid, I need to click a button to do something with this object (send it to a microflow for example). Usually, we add buttons inside the Datagrid, but I need to use a button outside of the Datagrid. Is it possible?
asked
2 answers
4

Hi Maxim,

There is no default functionallity for this.

If the solution with the dataview listening to the grid doesn’t work (for instance whenn you need multi select or be able to click the button when you dit not select a row), the easiest way to  solve this is to move the datagrid button in CSS to the (fixed) place where you need it.

If the CSS option is not possible, you can add a custom on-click nanoflow that toggles the selection on the clicked row  (with an extra boolean field at the entity, or an extra non-persistent entity to mark your selection). With the microflow behind the button outside the datagrid you can retrieve your selected row(s) and perform the desired action. Make sure you reset your selection when you enter the page!

Usually I’ll use a listview instead of a datagrid because you have more options for layout and extra controls. But the above is also possible with a datagrid.

 

Regards, Diederik

answered
5

Hi Maxim,

 

Add a dataview that listens to the datagrid. In that dataview you can add your button. You can even do something with the visibility when $currentobject != empty…

 

Regards,

 

Andre

answered