I received RangeError: Maximum call stack size exceeded at String.indexO when trying to add a treenode to a treeGrid. What does this mean? How can I fix it?
Announcement
Collapse
No announcement yet.
X
-
It's terrible error reporting on the part of the browser, but what that means is that there was an infinite loop. What you probably did was add a node that was already in the tree and already has children, creating an infinite loop. If you meant to instead duplicate an existing node, you need to remove its children first.
-
It looked like it worked. I used the code:
var newTreeNode = treeGrid.dataSource.copyRecord(treenode);
newTreeNode.name = "New name";
newTreeNode.id = "New id";
newTreeNode.children = null;
treeGrid.addData(newTreeNode);
But then I see an error message:
ISC_Core.js:1259 *17:34:08.201:XRP9:WARN:RPCManager:Error: server returned invalid JSON response - response: {status: -16,
data: "Error: server returned invalid JSON resp..."[44],
httpResponseCode: 200,
httpResponseText: "\r\n\r\n\r\n\r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n \r\n \r\n\r..."[256],
transactionNum: 6,
clientContext: Obj,
internalClientContext: undef,
httpHeaders: Obj,
context: Obj,
operationId: "newInfo_add",
operationType: "add",
startRow: 0,
endRow: 0,
totalRows: 0}
And there is no change made to the treeGrid. The duplicate treeNode has not been added to the treeGrid.
Any ideas?
Comment
-
Your tree is connected to a DataSource, so when you add a node, it tries to really add it to the DataSource. It looks like the "add" operation on your DataSource is broken - your server just returns invalid data (not JSON). Since the "add" operation failed, the node isn't shown as added in the UI.
If you're trying to really add a new node to the DataSource data, you need to fix the add operation.
If you have some other use case, where you want a new node shown in the tree, but don't really want to add it to the DataSource, you can use DataSource.updateCaches() to basically tell your UI components that a new record has already been added on the server.
Comment
-
Yes. The DataSource isn't broken, your server is. The DataSource is submitting the necessary data to the server and the server evidently isn't handling it.
You haven't mentioned what kind of DataSource you're using, but you should start with the Data Integration chapter of the QuickStart Guide.
Comment
Comment