Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
WebTree & Ajax - forcing a postback from the client.
posted

I have an AJAX enabled application that uses the WebTree and works well.  However, I am adding search capability that requires the use of javascript on the client to react to a row onclick event on a table.  I wrote a javascript function to handle the click event and search my tree to get to the correct node.  However, I want to force a partial postback to that the UltraWebTree_NodeClick event is fired.  I would think that using .NeedPostBack = true; would work, but nothing seems to happen.  Please see my code below.

        function SetNode(cat1, cat2, cat3){
           var tree = igtree_getTreeById("UltraWebTree1");
     var nodes = tree.getNodes();
     for (var i = 0; i < nodes.length; i++){
        if (nodesIdea.getDataKey() == cat1){
           nodes = nodesIdea.getChildNodes();
           for (var x = 0; x < nodes.length; x++){
              if (nodes[x].getDataKey() == cat2){
                nodes = nodes[x].getChildNodes();
                for (var y = 0; y < nodes.length; y++){
                  if (nodesYes.getDataKey() == cat3){
                     //Found IT!
                     nodesYes.setSelected(true);
                     //Force the post back!
                     tree.NeedPostBack = true;
                  };
                };   
              };
           };
        };       
     };
        }

Ideally the user would not see the postback - it would be exactly as if the user had clicked on the themselves.

Thanks,

Rob

 

Parents Reply Children