Skip to Content

sap.m.table cells not preserving cell order on Sorting, after updating cells binding information


In a sap.m.table, I am trying to provide functionality to reorder columns and their respective column cells. Currently, I am using the sap.m.table methods insertColumn() and removeColumn() to change the order of the columns. For the respective columns cells, I obtain the cell binding path for each of the column cells that need to change order and then update the respective cells with the new binding path.

It displays fine on the UI, but then when I go to sort a
specific column I get some unexpected results. Where the columns data will
appear across two different columns. See images below. 
for(var i = 0; i < oTable.getItems().length; i++)
	var bindingInfo = this.productTable.getItems()[i].getCells()[indexToInsert].getBindingPath("text");
	var bindingInfo2 = this.productTable.getItems()[i].getCells()[indexToInsert+1].getBindingPath("text");
	this.productTable.getItems()[i].getCells()[indexToInsert + 1].bindText(bindingInfo);

Original Table:

Moving Columns and Cells Prior to Sorting

After Sorting, cell data located in two different columns. (Expanded Number of Rows to show the results).

Would really appreciate some guidance on what could be causing this problem. Thank you.

capture.png (24.7 kB)
capture.png (24.7 kB)
capture1.png (26.0 kB)
capture2.png (48.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers