Skip to Content
avatar image
Former Member

Multiselect modify event

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

multiselect.png (1.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 10, 2017 at 09:35 PM

    Hi David

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

    Thanks

    Dennis

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 11, 2017 at 05:17 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 09, 2017 at 06:57 PM

    Hi David

    Can you tell us how you disabled the checkboxes?

    thanks

    Dennis

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member
      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