A strange JScript behavior

Discussion in 'ASP .Net Web Controls' started by Maris Janis Vasilevskis, Apr 24, 2006.

  1. Hi,

    Of course, I know, that the old WebControls are unsupported (I use treeview.htc copyrighted 2000-2003)
    However, it seems to be a JScript problem (I use IE 6.0 with all updates).
    The problem seems to be with some too early destroy when function called in return statement.

    My task is to find node index from node data at client side.
    My solution:

    function NodeIndexFromNodeData(parentNode,aNodeData) {
    var children=parentNode.getChildren();
    var i,n=children.length;
    var node, nodeData;
    var s;
    for(i=0;i<n;i++) {
    node=children;
    nodeData=node.getAttribute("NodeData");
    // s=node.getNodeIndex();
    if(nodeData==anodeData) return node.getNodeIndex();
    s=NodeIndexFromNodeData(node,aNodeData);
    MyDebugOutput('s='+s);
    if(s) return s;
    }
    return '';
    }

    As written, MyDebugOutput shows s=null after correct data found.
    If I uncomment the nonfunctional assignment before return, everything works.

    Any ideas?

    Mahris

    P.S. I have also a true TreeView problem. Maybe somebody has any experience with the unsupported version?
    I cannot retrieve text attribute from a node which never has been visible.

    I create my tree at server side (NET 1.1) with a command set like
    node=new TreeNode();
    node.Text=sometext;
    node.NodeData=anothertext;
    ParentNode.Nodes.Add(node);

    When I process the tree at client side, I can apply to a node commands
    node.getAttribute("NodeData");
    node.getNodeIndex();
    However, node.getAttribute("Text"); throws exception.

    My current workaround: set "expanded" to true for all nodes till desired, and only then
    node.getAttribute("Text");

    I wonder whether anybody knows some way to activate attributes without visual expanding.
     
    Maris Janis Vasilevskis, Apr 24, 2006
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sstark
    Replies:
    0
    Views:
    574
    sstark
    Mar 6, 2005
  2. ryang
    Replies:
    1
    Views:
    1,147
    Wes Groleau
    Apr 11, 2005
  3. Apogee

    Strange Behavior with ViewState

    Apogee, Jul 3, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    423
    Apogee
    Jul 3, 2003
  4. Jon Maz
    Replies:
    4
    Views:
    1,540
    Jon Maz
    Sep 9, 2004
  5. Maxwell2006
    Replies:
    5
    Views:
    2,631
    Steven Cheng[MSFT]
    Mar 7, 2006
  6. Mantorok Redgormor
    Replies:
    70
    Views:
    2,416
    Dan Pop
    Feb 17, 2004
  7. John Bentley
    Replies:
    14
    Views:
    615
    Jim Ley
    Feb 5, 2004
  8. VK
    Replies:
    4
    Views:
    524
    Thomas 'PointedEars' Lahn
    Jan 12, 2006
Loading...