Skip to Content
0
Former Member
Jul 05, 2015 at 02:44 AM

sap ui5 table deselection issue

172 Views

Hi experts

im facing an issue

in sap ui table

i have to select a max number of rows : that is 19 rows ,

after that is done i have to disable select of any further rows ,

but along with that i have to enable deselect the already selected rows ,

which is not happening as of now

here is my code

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

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

// selectionBehavior: sap.ui.table.SelectionBehavior.RowSelector,

setFixedRowCount:18,

//navigationMode : sap.ui.table.NavigationMode.ScrollBar,

visibleRowCount : 60,

rowSelectionChange: function(e) {

////////////////////////////akshay

var indices = e.getParameter('rowIndices');

for (var i = 0; i < indices.length; i++) {

var idx = indices[i];

if (oTable.isIndexSelected(idx)) {

/////////////////////////for current and previous row

var cxt = oTable.getContextByIndex(idx);

var arr = [];

arr = oTable.getSelectedIndices();

var selectedrowcount = arr.length;

var ra = parseInt(selectedrowcount);

if((ra > 19) )

{

// overlay_test.open();

oTable.mProperties.selectionMode = "None"

}

////////////////////////for row count and popup

}

}

/////////////////////////////akshay

}

}