Is it possible to implement a function to drag and drop rows on Datagrid?
I'd like to know how to do it.
Hi Tsubasa,
The latest version 2.9.0 allows drag and drop of the grid rows.
Here's the client action to be used to achieve this feature:
ToggleRowDragging
Description/Usage: Use to allow the grid rows to be dragged and reordered. By default, the data grid does not allow to drag rows. Reordering won't work if the grid has columns with active sort or row checkboxes.
Parameters:
It's a public client action in the OutsystemsDataGrid module available to enable / disable Row Dragging.
Hi Ravi,
Thank you. I didn't know that action.
I set new ClientAction (MyGridOnInitialize) to OnInitialize here.
In that action, I did like this.
But I still can't drag&drop rows... I'm not sure..what am I missing?
Would you happen to know why this is happening?
Hi @Tsubasa Yoshikawa
Can you share your implementation? I just did a quick test and it's working as expected.Keep in mind that it only works when using the row headers and the numbers are kept, ie, only the row content itself will be moved.Cheers,GM
Here's a working example if that can help you anyways.
https://personal-t4mpz2cn.outsystemscloud.com/DataGrid_Sample/UserList
There's nothging special configured, just called the action in OnInitialize event, same like you did it in your screenshot above.
Are there any other custom scritps added on your screen? Kindly share the URL or OML file so we can check the behaviour.
Hi,
I was under the impression that the row headers and the numbers are moved.
I understood they are kept.
I got what I wanted.
Thanks.
Hi ,
I'm sorry to ask after making as solution but,
I got an issue.
Like below, after grouping by "Year" on grid, I tried to drag and drop rows inside each "Year" but, I get this error, I can't drag rows....
Are you familiar with this error? I'm not sure where there is a problem....
Check the feature requirements in the client action description since you might have one of these - "Reordering won't work if the grid has columns with active sort or row checkboxes".
Using simply the group cols, I could make it work without any issues.