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,
Thank you for your patience. I am doing some research into what may be causing this issue. I will have a progress update for you within a few business days.
Please let me know if I may be of further assistance with this matter.
Sincerely,Mike P.Developer Support EngineerInfragistics, Inc.www.infragistics.com
forcing ie9 into ie8 modus did not help.
I am on version Infragistics4.Web.v10.3, Version=10.3.20103.2134 by the way.
edit: edited the page, the error is there, after I found out what is causing.
I added a comment in the code behind. If you have any questions, please ask.
I dont know how get around this complex loading of controls.
hello,
thanks for your help.
going for it, be patient ;)
Can you please provide me with some more information; I have a couple questions for you. What are you trying to accomplish in the webDataTree_NodeClick? Why do you need to postback?
okay, i try to be as clear as possible:
I have a page with a masterpage, containing a custom control with a tree and a placeholder next to each other.
After the user clicks a node, I read some object ID from the node. Depending on the ID different controls have to be loaded into the placeholder. Thats basically all. Now I will show you the page life cycle, that for me is the only way to get this working:
page is fully loaded
user clicked a node
javascript function is run
javascript function calls a postback
on server side in tree control OnLoad I decide what to do with the postback.
In case the user just selected a node, I fire an event from my own TreeControl (which contains a simple UltraWebTree), lets say OnNodeClicked().
the page is subscribed to this event to be able to load the correct control into the placeholder.
in the event handler I have to reload the whole page to make sure the dynamic control is added in the init method. If I would load and add them in the handler, things will go wrong and the added control can not fire events, because they are not loaded after this point.
I am in the process of making a sample to demonstrate this behavior. I will update this forum thread when I have finished the sample.
Hello Mike,
I am excited about what you can find out.
I was not able to reproduce this error in my example nor productive solution.
Thank you for your continuous support with this matter.
maybe you can also help me here: :)
http://community.infragistics.com/forums/t/60167.aspx
Waiting for some reply for a month now :(
Thank you for the update. I will follow up in a few days to see how you are doing upgrading versions.
Please let me know if you have any questions concerning this matter.
that are good news I guess ;)
Going to try it out on this week, not always an easy task to switch versions for the whole solution, stay tuned.
Thank you for the update. I have been able to reproduce this issue in the sample you provided in your last update. I recommend that you upgrade to the latest service release for 10.3 which is 2187. I have tested and have been unable to continue to reproduce it in 2187.
To obtain the latest service release please see the following steps:1. Go to www.infragistics.com and select the My & IG menu item.2. Select the My Keys & Downloads page.3. Click the product key for the product you wish to download the latest service release for.4. Scroll down to the service release section and click the service release for your product.
I am running Windows 7 Professional SP 1
and
Visual Studio 2010 SP 1
Actually what I was trying to achieve is not an issue any more. I managed to get everything running as I was trying to, but with this frustrating error, that comes up from time to time.
I wanted a WebDataTree with a WebDataMenu, as I started out the error was there any time I right clicked a node, that was my reason to create this thread. Things became better, but not satisfying.
I will polish the sample from the unnessasary code and upload a new one.
EDIT: Ok wow all my edit text did not make it into the post. :((((
Short version: the linked solution will cause the error by right clicking the node called "one" after running/compliing the solution 5 times on average with vs2010sp1 and ie9
Deleting the "ig_res" folger will make the page look ugly but fix the error (interesing, eh?)