问题
Here is the link for the sample from DOCS for Drag and Drop
For adding the rows down to each other from table1 to table2 I have changed(line 149 in controller Before to After
)
moveToTable2: function() {
this.getSelectedRowContext("table1", function(oSelectedRowContext) {
var oTable2 = this.byId("table2");
var oFirstRowContext = oTable2.getContextByIndex(0);
// insert always as a first row
var iNewRank = this.config.defaultRank;
if (oFirstRowContext) {
iNewRank = this.config.rankAlgorithm.After(oFirstRowContext.getProperty("Rank"));
}
// Here in the above line
this.oProductsModel.setProperty("Rank", iNewRank, oSelectedRowContext);
this.oProductsModel.refresh(true);
// select the inserted row
oTable2.setSelectedIndex(0);
});
},
On performing this the rows get added down to each other , but drag and drop of rows doesn't work,
I understood that the rank algorithm changes accordingly but How does the rank affect here while drag and dropping the rows ?
I couldn't find other such examples to look more in to this ,
Any explaination or any guiding links on this is really appreciated and would be much helpful, TIA
来源:https://stackoverflow.com/questions/60426558/how-to-add-the-rows-at-last-and-perform-drag-and-drop-accordingly-for-the-demo-s