Web Site

 Client Side Javascript Interface

Keep ASTreeView free, keep ASTreeView update. Please make a donation to support the development.
  • English
  • 中文
Common Assembly Version: 1.1.5.0
Client side javascript interface for select, check, drag and drop. Please select/check/dragdrop nodes to see the effect.
CONSOLE
aspx code
<ct:ASTreeView ID="astvMyTree" 
        runat="server"
        BasePath="~/Javascript/astreeview/"
        DataTableRootNodeValue="0"
        EnableRoot="true" 
        EnableNodeSelection="true" 
        EnableCheckbox="true" 
        EnableDragDrop="true" 
        EnableTreeLines="true"
        EnableNodeIcon="true"
        EnableCustomizedNodeIcon="false"
        EnableDebugMode="false"
        EnableContextMenuAdd="false"
        EnableParentNodeExpand="true"
        OnNodeSelectedScript="nodeSelectHandler(elem);"
        OnNodeCheckedScript="nodeCheckHandler(elem);"
        OnNodeDragAndDropCompletingScript="dndHandler(elem);" />
javascript code
    <script type="text/javascript">
        function nodeSelectHandler(elem){
            var val = "selected node:" + elem.parentNode.getAttribute("treeNodeValue");
            document.getElementById("<%=divConsole.ClientID %>").innerHTML 
            += (">>" + val + "<br />");
            
        }
        
        function nodeCheckHandler(elem){
            var cs = elem.parentNode.getAttribute("checkedState");
            var csStr = "";
            switch(cs){
                case "0":
                csStr = "checked";
                break;
                case "1":
                csStr = "half checked";
                break;
                case "2":
                csStr = "unchecked";
                break;
            }
            var val = csStr +" node:" + elem.parentNode.getAttribute("treeNodeValue");
            document.getElementById("<%=divConsole.ClientID %>").innerHTML 
            += (">>" + val + "<br />");
            
        }
        
        function dndHandler( elem ){
            document.getElementById( "<%=divConsole.ClientID %>" ).innerHTML 
            += ( ">>node dragged:" + elem.getAttribute("treeNodeValue") + "<br />" );
        }
    </script>
 


Dear friend,

    ASTreeView license has been updated, please visit the License & Pricing page for detial. Thank you.