cancel
Showing results for 
Search instead for 
Did you mean: 

sap ui5 table conditional row selection

Former Member
0 Kudos

Hi experts

I am trying to enable row selection only when my max selected row count = 19

my table is as follows

var oTable = new sap.ui.table.Table("tableid", {

    selectionMode :  sap.ui.table.SelectionMode.MultiToggle,

  visibleRowCount : 60,

}

but the attach row selection takes place even after that ,

please help

here selection mode is a global variable

if(selectionmode == true )

    {

    oTable.attachRowSelectionChange(function(){

    

       var arr=[];

      

      

       arr =  oTable.getSelectedIndices();

      

    

      

        var selectedrowcount  = arr.length;

      

        var rat = parseInt(selectedrowcount);

       if((selectedrowcount)==19)

         {  overlay_test.open();

    selectionmode = false;

     

   

         }   

  

  });

    }

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182862
Active Contributor
0 Kudos

Hi Akshay

I believe that this is related to the other posting. I suggest that you DO NOT post your question more than once.

There is an example that allow selection for first two rows. I hope you can improvise it to suit your requirement.

http://jsbin.com/kavuv/edit?html,js,output