K
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';
}
}
}
}
}
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';
}
}
}
}
}