Hello,
I tried to build in a WebDataMenu into our WebDataTree which normally was used to just select an item, postback the page with AutoPostBack-NodeClick on and load some stuff on the server to refresh controls...
Now I was running into problems, but I seem to have solved them by avoiding using client and server events (NodeClick) at the same time, as I now just use client events which themselves postback the page if nessasary.
the result is this:
<script language="javascript" type="text/javascript">
<!--
var lastNode = null;
var menuClick = false;
function treeWebDataMenu_ItemClick(menu, eventArgs) {
menuClick = true;
switch (eventArgs.getItem().get_key()) {
case "makeTemplate":
if (lastNode != null) {
__doPostBack('makeTemplate', lastNode.get_valueString());
}
break;
case "delete":
__doPostBack('delete', lastNode.get_valueString());
function webDataTree_NodeClick(tree, eventArgs) {
lastNode = eventArgs.getNode();
var menu = $find("<%= treeWebDataMenu.ClientID %>");
if (menu != null && eventArgs.get_browserEvent() != null && eventArgs.get_browserEvent().button == 2) {
menuClick = false;
menu.showAt(null, null, eventArgs.get_browserEvent());
} else {
if (lastNode != null && menuClick == false) {
__doPostBack('select', lastNode.get_valueString());
// -->
</script>
<ig:WebDataTree ID="webDataTree" runat="server" SkinID="WorkplaceTree" SelectionType="Single">
<%--OnNodeClick="NodeClicked"--%>
<%--<AutoPostBackFlags NodeAdded="On" NodeClick="On" />--%>
<DragDropSettings EnableDragDrop="True">
</DragDropSettings>
<ClientEvents NodeClick="webDataTree_NodeClick" />
</ig:WebDataTree>
<ig:WebDataMenu ID="treeWebDataMenu" runat="server" Style="margin-bottom: 0px" IsContextMenu="True">
<Items>
<ig:DataMenuItem Text="Als Vorlage verwenden" Key="makeTemplate">
</ig:DataMenuItem>
<ig:DataMenuItem Text="Löschen" Key="delete">
</Items>
<ClientEvents ItemClick="treeWebDataMenu_ItemClick" />
</ig:WebDataMenu>
------------------
everything is working as indented, BUT sometimes and really irregular I get this javascript error in the set_activeNode function:
_activeNode seems not to be what is expected at this point, but why?
the error says "_activeNode" does not support function "get_sytleElement()".
I can not 100% reproduce this error, i just comes up after 2-20 clicks in no obvious order or pattern. :(
thanks for reading :)
any help?
Carsten
Hello Carsten,
I have done as you suggested and ran the page as a secondary page and then navigated to it by URL from another page. I am still unable to reproduce this issue. The issue may be related to a setting specific to your environment or application. What are the OS and IDE you are running? Can you please provide me with a more update date sample of what you are trying to achieve?
Sincerely,Mike P.Developer Support EngineerInfragistics, Inc.www.infragistics.com
the only difference might be that I add the page to my project to test it. (but completly undependent except web.config and the licences of course) I browse there by entering the URL and the error can be reproduced this way. (Internet Explorer 9 or IE 8)
Thank you for the update. I have done as you suggested and right clicked the node names “One” without selecting a node first and am unable to receive the error. I have done this both with and without debugging. I have tried clicking the node a few dozen times both with and without clicking on the node that expands out of it after. Do you have any other suggestions or steps to reproduce this error?
Hello Mike,
are you sure?
After the page loaded, try right clicking the node named "One" at once without selecting a node first. the error should occur every time you do that. Also make sure you are not debugging the code. As soon as you tab out of the browser or have a breakpoint hit, the error will not occur.
The error is exactly the same I get randomly(?) in our solution. This is the only way I could reproduce it calculated.
Good Luck
Thank you for the update. Using the sample you provided at an earlier date I have been unable to reproduce this issue. Are you still receiving the original error or has the error changed?
Please let me know if I may be of further assistance with this matter.