Skip to Content
0
Former Member
Aug 13, 2013 at 01:49 PM

Drag and Drop on Table rows

521 Views

Hi,

I´m currently building a Desktop Application with SAPUI5 and am trying to get a Table row draggable, e.g. sortable. I was looking at this code http://jsbin.com/iciyof/2/edit and tried to adapt it to the Table rows from just one table- later I want to drag a Row from one Table to another. So there are a few problems. The table´s size is bound to a model which is filled at sometime, when a textfield value is changed. After that, I try to run through the table via getRows and set them sortable.

$.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-sortable');

...

...

...

textfield.change(){

sap.ui.getCore().byId("positable").bindRows("/LieferkopfSatz('"+this.getLiveValue()+"')/Lieferpositionen");

sap.ui.getCore().byId("positable").setVisibleRowCount(sap.ui.getCore().byId("positable")._getRowCount());

for( var i = 0; i <sap.ui.getCore().byId("positable")._getRowCount();++i) {

$(jQuery.sap.byId("positable-rows-row"+i)).sortable();

};

};

So i read, that Controls can only be made draggable or sortable in the onAfterRendering() function. Is this right? Because that would explain, why nothing happens, when I try to make the rows sortable or draggable on their creation via textfieldChange().