Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > A strange JScript behavior

Reply
Thread Tools

A strange JScript behavior

 
 
Maris Janis Vasilevskis
Guest
Posts: n/a
 
      04-24-2006
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[i];
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is Server-Side Jscript (not Jscript.NET)? Maxwell2006 ASP .Net 5 03-07-2006 05:28 AM
JScript.Net (JScript 7.0) is official documented language VK Javascript 4 01-12-2006 06:48 PM
Porting from JScript to JScript.Net - compiler error Jon Maz ASP .Net 4 09-09-2004 10:24 AM
undefined behavior or not undefined behavior? That is the question Mantorok Redgormor C Programming 70 02-17-2004 02:46 PM
Which to Learn: Javascript, Jscript, JScript.NET, ECMA 262 (3rd ed)? John Bentley Javascript 14 02-05-2004 06:14 PM



Advertisments