Author Topic: tree grid + moveNodes() -> r is undefined  (Read 473 times)

Autoflow

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 17
    • View Profile
tree grid + moveNodes() -> r is undefined
« on: October 27, 2019, 09:33:07 pm »
Using tree grid i set dropModel like this:

Code: [Select]
dropModel.drop = function(evt, ui) {
                var tree = this.Tree();
                tree.moveNodes(ui.helper.data('Drag').getUI().nodes, ui.rowData);
            };

which results in this error when i rearange nodes:

Quote
TypeError: r is undefined pqgrid.min.js:16:12837
    moveNodes http://localhost/debian/public/js/pqgrid/pqgrid.min.js:16
    drop http://localhost/debian/public/js/autoflow/phpxpress/widgets/grid.js:2077  --> see dropModel.drop() above
    callFn http://localhost/debian/public/js/pqgrid/pqgrid.min.js:15
    onDropX http://localhost/debian/public/js/pqgrid/pqgrid.min.js:15
    onDrop http://localhost/debian/public/js/pqgrid/pqgrid.min.js:15
    onDrop self-hosted:1005

Can you tell me more about "r"?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4406
    • View Profile
Re: tree grid + moveNodes() -> r is undefined
« Reply #1 on: October 28, 2019, 09:35:54 am »
[ Only Pro members may read this post. ]

Autoflow

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: tree grid + moveNodes() -> r is undefined
« Reply #2 on: October 28, 2019, 06:30:59 pm »
As i see tree grid doesn't support multiple root nodes.
r is undefined is thrown when i try to move a root node below another parent.

https://jsfiddle.net/v17zw2np/

Example:
Moving file "H" below folder "Autoflow".

Are there any plans to support multiple root nodes?

Then i faced another issue:

I need tree grid for building a folder structure based on flat format. So every node is a folder.
When i load data (in jsfiddle above) all nodes without children are files and don't accept other nodes as children.
i.E. moving "Dashboard" below "Server" doesn't work.

Whats the easiest way for flat format to define every node (even them without children) as a folder?
In nested format i could add children:[] to every node, but i don't know how to accomplish this in flat model.




paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4406
    • View Profile
Re: tree grid + moveNodes() -> r is undefined
« Reply #3 on: October 29, 2019, 09:33:19 am »
[ Only Pro members may read this post. ]
« Last Edit: October 30, 2019, 10:05:18 pm by paramvir »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4406
    • View Profile
Re: tree grid + moveNodes() -> r is undefined
« Reply #4 on: October 30, 2019, 09:17:17 am »
[ Only Pro members may read this post. ]
« Last Edit: October 30, 2019, 09:50:09 pm by paramvir »

Autoflow

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: tree grid + moveNodes() -> r is undefined
« Reply #5 on: October 31, 2019, 09:52:38 pm »
A common root was one idea i came across too.

Unfortunately in my system a common root node is hard to communicate to clients.
Therefore i will prefer fixed root nodes in a first try.

Here another fiddle with rollback support activated but not working yet when resetting moved nodes.

https://jsfiddle.net/L8kne6z7/

Is this functionality basically implemented in 6.2.4?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 4406
    • View Profile
Re: tree grid + moveNodes() -> r is undefined
« Reply #6 on: November 01, 2019, 02:56:28 pm »
[ Only Pro members may read this post. ]