Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1615
Webdatatree clientside initialize event
posted

I am using a Webdatatree and I have two javascript functions I need to Initialize in the clientEvents. It looks like you can only have one function called by this event. I tried adding both but only one fires. Below are my functions. One for maintaining scroll position and the other for hiding checkboxes. I was going to try to combine the two but not having any luck yet. Is there a way to initialize both?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<script type="text/javascript">

 

 

function HideCheckbox(node) {

 

 

var

childCount = node.get_childrenCount();

 

 

var

ParentN = node.get_parentNode();

 

 

if (ParentN !== null

) {

 

 

var

checkbox = node._get_checkBox();

 

 

var

checkboxEl = node._get_checkBox().get_element();

 

 

if

(!checkboxEl && node._get_expandCollapseElement()) {

checkboxEl = node._get_expandCollapseElement().nextSibling;

}

 

 

if

(checkboxEl) {

checkboxEl.style.display =

 

"none"

;

}

}

 

 

for (var

x = 0; x < childCount; ++x) {

 

 

var

child = node.get_childNode(x);

HideCheckbox(child);

}

}

 

 

function init(tree, args) {

 

 

var

root = tree.getNode(0);

 

 

while (root != null

) {

HideCheckbox(root);

root = root.get_nextNode();

}

}

 

 

 

 

function maintainScrollBarPosition(sender, args) {

 

 

//subscribe to onscroll event

sender._element.onscroll = onScrollhandler;

 

 

if ($get('<%=HiddenField1.ClientID %>').value !== ""

)

sender._element.scrollTop = $get(

 

'<%=HiddenField1.ClientID %>'

).value;

}

 

 

function onScrollhandler() {

$get(

 

'<%=HiddenField1.ClientID %>'

).value =

$find(

 

'<%=WebDataTree2.ClientID%>'

)._element.scrollTop;

}

 

 

 

</script

>