openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

TreeTable Hierarchy Maintenance problem

Open pepejuarez opened this issue 8 years ago • 3 comments

OpenUI5 version: 1.52+ Browser/version (+device/version): Chrome 67 Any other tested browsers/devices(OK/FAIL):

URL (minimal example if possible): https://openui5.hana.ondemand.com/#/sample/sap.ui.table.sample.TreeTable.HierarchyMaintenanceJSONTreeBinding/code/Controller.controller.js

The example always pastes the items as the last ones of the children of the target item. But I want to paste at the beginning or in other position.

Steps to reproduce the problem:

  1. Change the line 132 in the example oNewParent.categories = oNewParent.categories.concat(this._aClipboardData); to oNewParent.categories = this._aClipboardData.concat(oNewParent.categories);
  2. Execute the example and cut the item Boys->Clothing->Shirt->Black T-Shirt
  3. Expand the tree as below image
  4. Paste the item in Women

What is the expected result? I expect that the hierarchy does not change What happens instead? The hierarchy has changed, for example clothing was expanded, and now it is collapsed.

Any other information? (attach screenshot if possible)

pepejuarez avatar Jun 29 '18 11:06 pepejuarez

Hi @pepejuarez,

I was able to reproduce this and created an internal ticket #1880373492 for the owners of that sample to check on this.

The status of the issue will be updated here in GitHub.

Best regards, Merlin

RandomByte avatar Jun 29 '18 12:06 RandomByte

Hi @pepejuarez ,

The state of the tree will only be preserved, if items are appended to a node. As you have experienced, inserting items at the beginning or in between corrupts the state of subsequent nodes. Therefore we do not recommend it and there is no example showing it. But maybe we should add this information to the example to avoid confusion...

Best regards, Alexander

JumpNRun avatar Jul 02 '18 13:07 JumpNRun

Hi, Is there any update here?

Best Regards, Tritty

Tritty avatar Apr 29 '22 09:04 Tritty