Excute code from treeview node click

M

Mark Goldin

I'd like to run some script (on a client) when the user selects a node.
How do I do that?
 
C

CMA

in the navigation url field of the tree node put "javascript:process();" and
put the process() function in the page in <script> section.
so then it will be getting executed.

hope this helps,
CMA
 
M

Mark Goldin

What is a name of that property?

CMA said:
in the navigation url field of the tree node put "javascript:process();" and
put the process() function in the page in <script> section.
so then it will be getting executed.

hope this helps,
CMA
 
C

CMA

<body MS_POSITIONING="GridLayout">

<form id="ocx" method="post" runat="server">

<iewc:TreeView id="TreeView1" style="Z-INDEX: 102; LEFT: 337px; POSITION:
absolute; TOP: 114px" runat="server"
SystemImagesPath="/webctrl_client/1_0/treeimages/">

<iewc:TreeNode NavigateUrl="javascript:alert('1');"
Text="Node0"></iewc:TreeNode>

<iewc:TreeNode NavigateUrl="javascript:alert('1');"
Text="Node1"></iewc:TreeNode>

</iewc:TreeView>

</form>

</body>

when you click on the node, will excecute the javascropt. to your need,
include a javasript function name without using alert()
 
M

Mark Goldin

Thanks for all your help.

CMA said:
<body MS_POSITIONING="GridLayout">

<form id="ocx" method="post" runat="server">

<iewc:TreeView id="TreeView1" style="Z-INDEX: 102; LEFT: 337px; POSITION:
absolute; TOP: 114px" runat="server"
SystemImagesPath="/webctrl_client/1_0/treeimages/">

<iewc:TreeNode NavigateUrl="javascript:alert('1');"
Text="Node0"></iewc:TreeNode>

<iewc:TreeNode NavigateUrl="javascript:alert('1');"
Text="Node1"></iewc:TreeNode>

</iewc:TreeView>

</form>

</body>

when you click on the node, will excecute the javascropt. to your need,
include a javasript function name without using alert()
 
M

Mark Goldin

Is it possible to to send an atribute value thru NavigateUrl?
Something like this:
NavigateUrl="javascript:functionname(attributename);"
 
C

CMA

same way you can specify the attribute while creating the tree, right?

<script language=javascript>
function tell(strVal)
{
alert(strVal);
}
</script>


<iewc:TreeNode NavigateUrl="javascript:alert('0th element');" Text="Node0"
ID="node00"></iewc:TreeNode>
<iewc:TreeNode NavigateUrl="javascript:tell('1st element');" Text="Node1"
ID="node11"></iewc:TreeNode>

likewise you can give the ID to the parameter also.
i mean not like tell(this.ID); // it is not working
when creating you know the ID of the node, so u can set the parameter to the
ID.
like if the ID of the node is "aaaa1111",
then set the function as, tell('aaaa1111');

CMA
 
M

Mark Goldin

I see.
That's what I do in my none-net development.
I thought that dontnet is really something new.
Is it possible to have tree data available on the client side?
 
C

CMA

yes, the process is somewhat same. but the architecture is different. in
asp, you execute the page line by line and give the output to the client
side. in .net, the whole page will execute and give the output to the user
at once. and server side programming is easy since all the libraries r
available.

what do u mean by "tree data " can u explain a bit more???

CMA
 
M

Mark Goldin

I meant since xml is loaded into the tree it would be possible to access it
on the client.
Is it all wrong?
 
C

CMA

as to my knowledge it is not possible since it is creating the tree with
your XML, but it is not giving the client the detailsof XML. after running
the document check the source code of the page. the details in tree nodes u
can access with clientside script. not the others..

CMA
 
M

Mark Goldin

If a node in the tree has NavigateUrl="javascript:test();"
then the node is not getting highlighted when it's clicked.

Can you explain, why?

Thanks
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top