Author Topic: [QA] TreeGrid - Drag & Drop  (Read 440 times)

unbinara

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 16
    • View Profile
[QA] TreeGrid - Drag & Drop
« on: September 08, 2023, 06:49:01 am »
1. react 18 & pqgrid 9.0.1
2. Q&A
- https://paramquery.com/pro/demos/dnd_trees

(2-1) how to apply flat (only level 1) to right treegrid when nodes(exists parent) drag and drop to right treegrid
        - i don't know this, so i tried to change the right tree grid to nomal grid(there is drag and drop also)
          however, when i move(drag and dropt) to rigth nomal grid, nodes moved but data is now show...ㅠㅠ...

(2-2) when only use drag and drop, if i drag and drop to right grid, i can get changes data (add or delete)
        however, i can not get updated data from getchanges method when just drag and drop in left treegrid only (up and down drag)
       
        is that possible get updated data from getchanges , when just moved the same grid (up and down drag -> change level in same tree grid)
        if it is possible , how ?

unbinara

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [QA] TreeGrid - Drag & Drop -- more detail
« Reply #1 on: September 08, 2023, 11:03:52 pm »
i can not explain above question..so, i create stackbiliz and capture..
https://stackblitz.com/edit/stackblitz-starters-u5bzil?file=src%2FApp.js

(1) i drag and drop from right to left => (picture 2 : move 3 rows but data is not show..)
(2) i drag and drop in only right (from up to down and changes parent) ==> but there is no updatelist.... (picture 3)

<picture 1>
1.png
<picture 2>
2.png
<picture 3>
3.png

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: [QA] TreeGrid - Drag & Drop
« Reply #2 on: September 11, 2023, 10:46:27 pm »
1) Is it possible for you to complete the stackblitz implementation as per the screenshot.

2) getChanges doesn't capture reordering of nodes. There is an event moveNode which can be useful to sync the ordering of nodes in remote datasource.

https://paramquery.com/pro/api#event-moveNode
« Last Edit: September 11, 2023, 10:50:57 pm by paramvir »

unbinara

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [QA] TreeGrid - Drag & Drop
« Reply #3 on: September 12, 2023, 09:56:35 pm »
thanks for your reply.
However, i can not understand still
1) Is it possible for you to complete the stackblitz implementation as per the screenshot.

I tried addnodes, addrow or refresh after addnodes(addrow), even use this.data(..) after addnodes
In dropmodel ...but, i can not make to show the data on grid..
How to show data?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: [QA] TreeGrid - Drag & Drop
« Reply #4 on: September 15, 2023, 06:05:15 pm »
It's due to editable: false in lGridOption

It works fine after removing editable: false

https://stackblitz.com/edit/stackblitz-starters-1nptcz?file=src%2FApp.js

Please let me know if you have any other question related to it.
« Last Edit: September 15, 2023, 06:06:48 pm by paramvir »