Regards,
I have a problem with two RadTreeview, the scenario is:
1) In a WebUserControl, I have a radtreeview.
2) From the WebUserControl, I calling a aspx page is loaded in a RadWindow
3) This page contains another radtreeview
4) Before closing the child window, it runs a function that in turn calls a function of the parent window (as is in the examples of telerik).
5) The function of the parent window receives as argument the Treview RootNode of the child window with all the nodes that were created in the window.
6) The function of the parent window is to be inserted into specific nodes (in the parent window treeview)newly created nodes in the child window.
7) Therefore, from the function of the parent window, I need to use the method 'findNodeByValue' in order to know which node to insert the nodes created from the window.
8) The first time you invoke the function works fine (ie, the window opens, new nodes are created and inserted into the treview of the parent window and then closes the window).
9) But if I try to rerun the procedure immediately (open the window, create and insert nodes in the treeview of the parent window), it throws a javascript to use the method 'findNodeByValue'. The exception code is: '-2146823277' and the error message is: 'Can not execute code from a script Freed. "
It is noteworthy that in shaping the RadWindow is the property 'ReloadOnShow' to True because I require it to recharge the aspx of the window every time you open.
The truth did not find much relevant information about the javascript error and I found not applicable to the scenario that I mentioned.
Also, to clarify that by default, is not doing a recursive search on any node since it is assumed that the child page is refreshed every time you open (and actually does).
The next is the code of javascript function to receive the nodes and insert the nodes in the parent window treeview:
I appreciate any help you can provide.
Regards,
Camilo Bernal
I have a problem with two RadTreeview, the scenario is:
1) In a WebUserControl, I have a radtreeview.
2) From the WebUserControl, I calling a aspx page is loaded in a RadWindow
3) This page contains another radtreeview
4) Before closing the child window, it runs a function that in turn calls a function of the parent window (as is in the examples of telerik).
5) The function of the parent window receives as argument the Treview RootNode of the child window with all the nodes that were created in the window.
6) The function of the parent window is to be inserted into specific nodes (in the parent window treeview)newly created nodes in the child window.
7) Therefore, from the function of the parent window, I need to use the method 'findNodeByValue' in order to know which node to insert the nodes created from the window.
8) The first time you invoke the function works fine (ie, the window opens, new nodes are created and inserted into the treview of the parent window and then closes the window).
9) But if I try to rerun the procedure immediately (open the window, create and insert nodes in the treeview of the parent window), it throws a javascript to use the method 'findNodeByValue'. The exception code is: '-2146823277' and the error message is: 'Can not execute code from a script Freed. "
It is noteworthy that in shaping the RadWindow is the property 'ReloadOnShow' to True because I require it to recharge the aspx of the window every time you open.
The truth did not find much relevant information about the javascript error and I found not applicable to the scenario that I mentioned.
Also, to clarify that by default, is not doing a recursive search on any node since it is assumed that the child page is refreshed every time you open (and actually does).
The next is the code of javascript function to receive the nodes and insert the nodes in the parent window treeview:
var ArbolPresupuestoConfigurator_ReceiveData = function (nodesConfig) {and the code caller function from child window is:
/*
nodesConfig is a object passed to the function and the following is the structure of the object
var nodesConfig = {
nodes: null,
level: '',
idFlota: 0
}
where 'nodes' is the object that contains the root node (with child nodes) from the child window.*/
if (nodesConfig != null) {
switch (nodesConfig.level) {
case 'Flota':
var nodoFlota = nodesConfig.nodes.get_nodes().getNode(0)
if (nodoFlota != null) {
var esFlotaPersonalizada = nodoFlota.get_attributes().getAttribute('EsPersonalizada');
if (esFlotaPersonalizada == 'True') {
var nombreFlota = nodoFlota.get_text();
} else {
var idFlota = nodoFlota.get_value();
//The exception is fired here from the second time the function is called.
//treeArbolPresupuesto is the parent window treeview
var _currentNodoFlota = treeArbolPresupuesto.findNodeByValue(idFlota)
if (_currentNodoFlota != null) {
if (nodoFlota.get_nodes().get_count() > 0) {
treeArbolPresupuesto.trackChanges();
var nuevaActividad = nodoFlota.get_nodes().getNode(0);
_currentNodoFlota.get_nodes().getNode(0).get_nodes().add(nuevaActividad);
treeArbolPresupuesto.commitChanges();
}
}
}
}
break;
case 'Actividad':
break;
case 'Area':
break;
case 'Sistema':
break;
case 'SubSistema':
break;
case 'Material':
break;
}
}
}
var wizardToolbar_HandleButtonClick = function (sender, eventArgs) {Actually I am very upset with this problem since I have not found a solution and I promptly deliver development.
var button = eventArgs.get_item();
var commandName = button.get_commandName();
switch (commandName) {
case 'SaveAll':
//RootNode is the root node of the treeview in child window
var rootNode = treeConfig.findNodeByValue('-100');
nodesConfig.nodes = rootNode;
GetRadWindow().BrowserWindow.ArbolPresupuestoConfigurator_ReceiveData(nodesConfig);
GetRadWindow().close();
break;
case 'Cancel':
//TODO: Pendiente implementar.
GetRadWindow().close();
break;
case 'Undo':
window.location.reload();
break;
case 'Help':
//TODO: Pendiente implementar.
break;
}
}
I appreciate any help you can provide.
Regards,
Camilo Bernal