ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: jplevene on May 20, 2024, 02:15:42 am
-
I am trying to manually move a node (not with DND, using only JS) and use the following code:
$("#grid").pqGrid("Tree").moveNodes({nodes:[rowData], parent:new_parentId});
When I do above I get a JS error in pqGrid "Uncaught TypeError: t.forEach is not a function"
What am I doing wrong?
-
Forgot to say, error is generated in "getUniqueNodes"
-
Please correct the parameters.
var Tree = $("#grid").pqGrid('Tree');
Tree.moveNodes( [ rowData ], Tree.getNode( new_parentId ) );
-
I tried that and it still causes the same error:
tree.moveNodes({nodes:[rowData], parent:parent});
I even tried:
tree.moveNodes({nodes:[ tree.getNode(rowData["ID"]) ], parent:tree.getNode(parent["ID"])});
-
I'm only moving one node from one parent to another BTW.
Even if I don't set parent and omit it I still get the error, so the error is caused by the "nodes" value.
-
There are no curly brackets {} in the parameters to moveNodes
var Tree = $("#grid").pqGrid('Tree');
Tree.moveNodes( [ rowData ], Tree.getNode( new_parentId ) );