Tick event for checkbox
-
kambilot
ParticipantHas successfully completed the online course Intermediate (200)
Has successfully completed the online course Basics (100)
4 weeks, 1 day ago #66970Hello,
I am looking for the event for ticking a checkbox in a multiselect table, example:
sap.ui.getCore().byId(“Screenname–Tablename”).getItems().forEach(oItem => {
var itemID = oItem.getId();
if (sap.ui.getCore().byId(itemID + “-selectMulti”).onCheckboxChange) {
selectedCount++;
console.log(“selectedCount: “,selectedCount);
} else {
selectedCount–;
}
if (selectedCount >= maxSelections) {
disableAllCheckboxes();})
}But “onCheckboxChange” here dont’t work.
Thanks in advance.
Greetings Leonid
Armin Winkler
ModeratorHas successfully completed the online course Introduction
Has successfully completed the online course Intermediate (200)
Has successfully completed the online course Advanced (300)
Has successfully completed the online course Basics (100)
4 weeks ago #67093::Hi Leonid,
what you are looking for is presumably the ‘selectionChange’ event of the sap.m.Table, which is the basis for both the ‘Table’ as well as the ‘TableEnhanced’ widgets available in the Standard Content for Simplifier. After subscribing to that event, you could call the ‘getSelectedItems’ method on the table in order to determine the amount of selected items / checkboxes and act accordingly. If you need to deselect all items / checkboxes programmatically, there’s the ‘removeSelections’ method to do just that.
Please let us know if this helped you.
Kind regards,
Armin
You must be logged in to reply to this topic.