cancel
Showing results for 
Search instead for 
Did you mean: 

Multiselect modify event

david_bizer
Product and Topic Expert
Product and Topic Expert
0 Kudos

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..

Accepted Solutions (1)

Accepted Solutions (1)

former_member182862
Active Contributor

Hi David

Does this http://jsbin.com/wowenoz/edit?js,output help you to move forwards?

Thanks

Dennis

david_bizer
Product and Topic Expert
Product and Topic Expert
0 Kudos

hi Dennis,

this looks great. Thank you !

Answers (2)

Answers (2)

Sharathmg
Active Contributor
0 Kudos

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

Sharathmg
Active Contributor
0 Kudos

While looping through items, check if the item has the enabled property "true" and if yes, set selected as true.

former_member182862
Active Contributor
0 Kudos

Hi David

Can you tell us how you disabled the checkboxes?

thanks

Dennis

david_bizer
Product and Topic Expert
Product and Topic Expert
0 Kudos
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