I want to deselect all checkboxes in a DataGrid when a certain action (e.g., clicking a button) occurs.
What should I do?
OML is also attached.
Hi @Arakawa Haruka ,
You can check solution from this post: https://www.outsystems.com/forums/discussion/76205/outsystems-data-grid-how-to-reset-checkbox-selection-inside-client-action/ .
Update your JS from the button client action to the following script:
var gObj = OutSystems.GridAPI.GridManager.GetGridById($parameters.GridWidgetId);
var checkedRows = gObj.provider.selectedItems;
for (var i = 0; i < checkedRows.length; i++) { checkedRows[i].__osRowMetadata.delete("__rowSelection");
}
gObj.provider.refresh();
@Beatriz Sabino @Mihai Melencu
It worked! Thank you very much!
Hi Arakawa,
I have updated your .oml, specifically the JavaScript script in your ButtonOnClick action.
Hope this helps.
Hi, this seems to only uncheck the checkboxes without actually deselecting the rows.
You're right, I only focused on the deselect the checkboxes and missed the logic to deselect the row as well.