How to add the rows at last and perform drag and drop accordingly for the demo sample from documentation

守給你的承諾、 提交于 2020-03-03 13:59:07

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!