on 2017 Jun 09 4:30 PM
Hello ,
i'm currently using a MultiSelect mode on my table. After some items are selected, some actions are triggered and those checkboxes which were enabled are now disabled in the table.
I am not able to click on each of them. However, when i click the checkbox in the Table header it selects all checkboxes, even if they 're disabled. See the picture below:
Is there any way to handle the onClick of the checkbox in the column header, so it will only check enabled checkboxes? Making the checkboxes not editable didn't work..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Look for the event which is unique to the click on the table rows. Possibility that your event is generic and some other code is being trigerred.
It is very much possible to do a select all.
By default the table come with the option, you may need to assign an event handler and write for it. Else, have a button in table with select all/deselect all - toggle option
In handler method, loop through table items and set the selected option as true.
Regards,
Sharath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David
Can you tell us how you disabled the checkboxes?
thanks
Dennis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this._oTable.getItems().forEach(function(i) {
var oContext = i.getBindingContext().getObject();
var oSavedFlag = oContext.HRFSAVED;
var oCB = i.$().find('.sapMCb');
var oCheckBox = sap.ui.getCore().byId(oCB.attr('id'));
if (oSavedFlag === "true") {
oCheckBox.setEnabled(false);
} else {
oCheckBox.setEnabled(true);
}
});
This is the code for disabling the checkboxes. Setting setVisible as well as SetEditable to false didn't work either
User | Count |
---|---|
70 | |
8 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.