Solved

Looknig for an editable treeview

Posted on 2001-08-13
7
390 Views
Last Modified: 2012-05-04
I need a script to edit a treeview inside a browseer.  It need to be scripting language, VBscript or Javascript, do anyone know if such script exist somewhere?

I need to be able do drag and drop from the tree to move item up and down inside the browser.  The page is in ASP.
0
Comment
Question by:dabellei
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 13

Expert Comment

by:gbanik
ID: 6381404
You could use the Simple VB Tree Control for that or create your own control with the Tree Control embedded in it. Have you object placed in the ASP Page (actually executed at the Client). Use <CodeBase> Tag to avoid the control being installed at the client machine (at the client browser would call it).

All in all.... make your control whatever u want in VB. And then port it to your ASP Page. If you need help on how to pass data to your control from ASP... ask me?

GB.
0
 
LVL 2

Author Comment

by:dabellei
ID: 6381577
I don't really want to use VB in any way, no activeX at all, pur ASP code, VBSCript is ok or JavaScript, I need to run this over netscape or IE on PC or MAC as well.

And over all I need the Drag and Drop functionnality
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 28

Expert Comment

by:AzraSound
ID: 6381933
anything using only script is going to be slow...

one of the best out there is here:
http://www.ivanpeters.com/

youll notice its not very fast, but that is all you can expect using purely script
0
 
LVL 1

Accepted Solution

by:
raj_selvam earned 300 total points
ID: 6382766
If ur using javascript then follow this code.


=======================
<html>
<head>
<script LANGUAGE="JScript"><!--

var eFilterTableSelected = null;            // currently selected category folder
function SetupPage()
{
      folder_click( window.tblAll );
}

// Cursor is over a catgegory folder
function folder_mouseover(eTable)
{
      var srcImg = eTable.rows[0].cells[0].children[0].src;
      srcImg = srcImg.substr( 0, srcImg.length-5 ) + "1.gif"
      eTable.rows[0].cells[0].children[0].src = srcImg;
}

function folder_mouseout(eTable)
{
      if( eTable != eFilterTableSelected )
      {
            var srcImg = eTable.rows[0].cells[0].children[0].src;
            srcImg = srcImg.substr( 0, srcImg.length-5 ) + "0.gif"
            eTable.rows[0].cells[0].children[0].src = srcImg;
      }
}

// Cursor click on category folder
function folder_click(eTable)
{
      event.cancelBubble = true;

      if( eFilterTableSelected == eTable )
            return;

      var eText = eTable.rows[0].cells[1];
      eText.style.backgroundColor="#000080";
      eText.style.color="#FFFFFF";
      eText.style.fontWeight="bold";

      var eOldSelected = eFilterTableSelected;
      eFilterTableSelected = eTable;

      if( eOldSelected != null )
      {
            eText = eOldSelected.rows[0].cells[1];
          eText.style.backgroundColor="";
            eText.style.color="";
            eText.style.fontWeight="";

            folder_mouseout(eOldSelected);
      }
}
function group_click(eTable)
{
      // Check current state, and invert
      var bExpand;
      if( eTable.rows[1].cells[1].children[0].style.display == "none" )
            bExpand = true;
      else
            bExpand = false;

      // change the image
      var srcImg = eTable.rows[0].cells[0].children[0].src;
      srcImg = srcImg.substr( 0, srcImg.length-5 );
      srcImg += bExpand ? "1.gif" : "0.gif";
      eTable.rows[0].cells[0].children[0].src = srcImg;

      // toggle folder visibility
      var numFolders =       eTable.rows.length;
      var strDisplay = bExpand ? "block" : "none";

      for( i = 1; i < numFolders; i++ )
            eTable.rows[i].cells[1].children[0].style.display = strDisplay;
}


// Called when the filter selection is changed
function filter_onchange(strFilter)
{
      var m_strFilter = strFilter;
      strFilterExpression = m_strFilter;
      update_main();
}
function update_main()
{
      alert(strFilterExpression);
//      window.parent.frames.banner.refresh_tab( getFilterURL() );
}

function getFilterURL()
{
      // return selected item from tree
}

--></script>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>Date Range</title>
</head>

<body topmargin="0" background="back.gif" ONLOAD="SetupPage();">

<table border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td>
      </td>
    <td>
            <table ID="tblAll" border="0" cellspacing="0" cellpadding="0" style="font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);">
                  <tr>
                        <a href="javascript:filter_onchange(&quot;all&quot;)">
                        <td>
                              <img src="..\Filter\all1.gif">
                        </td>
                        <td>&nbsp;All&nbsp;
                        </td>
                        </a>
                  </tr>

                  <tr>
                        <td></td>
                        <table border="0" cellspacing="0" cellpadding="0">
                        <table border="0" cellspacing="0" cellpadding="0" Title="Click to Display/Hide Categories" style="font-family: Verdana; font-size: smaller; cursor:hand;"  ONCLICK="group_click(this);"><tr><td><img src="..\Filter\expand0.gif"></td><td><img src="..\Filter\group.gif">&nbsp;x</td></tr><tr><td></td><td>

                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;type:1&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>1</td></a></tr>

                        </table></td>

                        </table>

                        <table border="0" cellspacing="0" cellpadding="0" Title="Click to Display/Hide Categories" style="font-family: Verdana; font-size: smaller; cursor:hand;"  ONCLICK="group_click(this);"><tr><td><img src="..\Filter\expand0.gif"></td><td><img src="..\Filter\country.gif">&nbsp;xx</td></tr><tr><td></td><td>

                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;2&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>2</td></a></tr>


                        </table></td><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;3&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>3</td></a></tr>

                        </table></td><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;4&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>4</td></a></tr>

                        </table></td><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;5&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>5</td></a></tr>


                        </table></td><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;6&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>6</td></a></tr>


                        </table></td><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;7&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>7</td></a></tr>


                        </table></td><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;8&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>8</td></a>


                        </tr></table></td></table>


                        <table border="0" cellspacing="0" cellpadding="0" Title="Click to Display/Hide Categories" style="font-family: Verdana; font-size: smaller; cursor:hand;"  ONCLICK="group_click(this);"><tr><td><img src="..\Filter\expand0.gif"></td><td><img src="..\Filter\alert.gif">&nbsp;xxx</td></tr><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller;
                        cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;9&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>9</td></a></tr>

                        </table></td><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;10&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>10</td></a></tr>


                        </table></td><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;11&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>11</td></a></tr>

                        </table></td><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;12&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>12</td></a></tr>


                        </table></td><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;13&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>13</td></a></tr>


                        </table></td><tr><td></td><td>


                        <table border="0" cellspacing="0" padding="2" Title="Show Mobiles from this Category Only" style="display: none; font-family: Verdana; font-size: smaller; cursor:hand;" ONMOUSEOVER="folder_mouseover(this);" ONMOUSEOUT="folder_mouseout(this);" ONCLICK="folder_click(this);"><tr><a href="javascript:filter_onchange(&quot;14&quot;)"><td><img src="..\Filter\folder0.gif">&nbsp;</td><td>14</td></a></tr>

                        </table></td></table>

</body>
</html>

================

u want to add tree values dynamicaly, mail to me..
raj_selvam@hotmail.com

i expecting good points

raj_selvam
0
 
LVL 2

Author Comment

by:dabellei
ID: 6383956
Can you send it to me by email please so I can try it.


daniel_belleisle@hotmail.com

Thanks
0
 
LVL 1

Expert Comment

by:raj_selvam
ID: 6387081
sure
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question