Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery selection of TreeNode element not working
    primarykey
    data
    text
    <p>I've been having difficulty selecting the nodes of my IE Web Control TreeView. I'm running the code on IE8 Compatibility Mode (IE7 Standards Mode). </p> <p>I'm attempting to select the tree nodes like this: </p> <pre><code>$("tvns\\:treenode").css("color", "red"); </code></pre> <p>I have tried using this selector both inside a $(document).ready() function and also inside a function which is invoked on pressing a button after the TreeView has been populated. The two \ backspaces are there to escape the colon character. </p> <p>The TreeView HTML looks like this: </p> <pre><code>&lt;ciswc:TreeView ID="tvWorkArea1" onfocus="fn(this);" ondragstart="javascript:captureNode1();" class="ui-widget ui-widget-content" onclick="fnStoreEID(0)" runat="server"SystemImagesPath="Common/webctrl_client/1_0/treeimages/" onunhover="unHoverFunction('WorkArea')" EnableViewState="False" onhover="selectNode('Smart');" Height="100%" width="100%"&gt; &lt;/ciswc:TreeView&gt; </code></pre> <p>I should note that for some reason the TreeView HTML shows up as tvns:TreeView in the IE Developer Tools on running the application. It shouldn't affect the selection of the nodes in the tree though. </p> <p>Each node looks something like this: </p> <pre><code>&lt;tvns:treenode Expanded="True" Selected="true" NavigateUrl="#" NodeData="0"&gt; New Entity: &lt;/tvns:treenode&gt; </code></pre> <p>When the page initially loads, the TreeView exists, but no tree nodes exist yet. Later after the user has performed some operations, the TreeView will have been populated by the tree nodes. </p> <p>I have a button which invokes a function which contains the JQuery selector - I have debugged through the javascript and I can see that the code function IS being called, but it doesn't seem to be finding the nodes. </p> <p>Any ideas? </p> <p>I have tried selecting the tree nodes using pure javascript, but nothing is returned: </p> <pre><code>var nodes = document.getElementsByTagName("tvns:treenode"); for (i = 0; i &lt; nodes.length; i++) { nodes[i].style.colour = "red"; } </code></pre> <p>I notice that the HTML has runat="server" attribute. Could this be why I can't select the TreeView nodes? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload