473,385 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Code to add cursor changes for the 2.0 TreeView when using PopulateNodesFromClient

KJ
Rather than ask a question, I'm going to offer something here which
you may find useful. If you're like me, you want the end-user to know
that data is being loaded from the server. The javascript function
below adds a simple cursor change to href for the callback which
initiates the server-side TreeNodePopulate event. Unfortunately, it's
not perfect. You have to have a rough estimate as to how long the
method call will take (I chose 4 seconds in the example below). If
there's a better way to do this, I'd love to hear about it.

function ExtendTreeviewClicks()
{
var Anchors = document.getElementsByTagName("a");
if (Anchors && Anchors.length 0)
{
for (var a=0; a < Anchors.length; a++)
{
var PopHref = "javascript:TreeView_PopulateNode";
var TogHref = "javascript:TreeView_ToggleNode";
var TheId = Anchors[a].id;
var NewHref = "";

if (Anchors[a].href.substring(0, PopHref.length) == PopHref)
{
NewHref =
Anchors[a].href.replace(
/javascript:TreeView_PopulateNode/,
"javascript:document.getElementById('" + TheId +
"').style.cursor = 'wait';window.setTimeout('ExtendTreeviewClicks()',
4000);TreeView_PopulateNode"
);

Anchors[a].href = NewHref;
}

if (Anchors[a].href.substring(0, TogHref.length) == TogHref)
{
if (document.getElementById(TheId).style.cursor == 'wait')
{
document.getElementById(TheId).style.cursor = 'default';
}
}
}
}
}

Apr 26 '07 #1
0 2520

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dan | last post by:
We have a simple site. It's a frameset with two frames a left and a right. The left frame is essentially a list of records from a database (using a server-side repeater control). When you click...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
1
by: musosdev | last post by:
Hi guys I was using the Microsoft.Web.UI.WebControls extra namespace in my application to provide me with a TreeView control. I was using specifically ..GetNodeFromIndex(), SelectedNodeIndex and...
0
by: damiensawyer | last post by:
I have an ASP:Treeview control <asp:TreeView Id="TreeView2" PathSeparator = "|" OnTreeNodePopulate="PopulateNode" ExpandDepth="1" runat="server" cssclass="TreeControl"...
0
by: haegens | last post by:
I am making a .NET Application which has a TreeView Control in it. I have 3 levels of nodes. The toplevel is a rootnode which contains all other nodes. The second level holds one kind of nodes that...
1
by: Vinit | last post by:
Hi I have a form in which there is a treeview alongside a listview. Now I have certain conditions when the Listview control is disabled. When this happens I would want the Cursor to be of type...
9
by: Martin Randall | last post by:
Can anyone tell me if it is possible to get the TreeView control in ASP.Net 2.0 to allow node selection without triggering a postback? Thanks! Martin Randall
3
by: Ray Booysen | last post by:
Hi all I have a treeview bound to a sitemap. Once the user is logged in, I'm wanting the menu to expand to include additional items from a database while retaining the items in the sitemap. Is...
1
by: Chris Shepherd | last post by:
According to the docs, setting Cursor.Current will change the cursor being displayed, and block mouse events: "Setting the Current property changes the cursor currently displayed, and the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.