 |
|
 |
It Helps me lot
Thanx Again
|
|
|
|
 |
|
 |
The + and - images are not displayed on pageLoad. After refreshing or clicking on each nodes, they are displayed. What might be the reason?
|
|
|
|
 |
|
 |
I am using this treeview on a page and not using Frames . i want to open the link on one of the childnodes in the same window of the browser . how can I do that . With the present code when I click on any childnode with URL it opens in another window.
I tried by giving the value to "target" parameter but nothing happened.
Atul
|
|
|
|
 |
|
 |
hi all
I m new user of this group.
i am using javascript for creating treecheckbox. the problem is how to show the nodes name from xml file.
Plz.???????????????????
reply me as soon as possible.
thanks
snitu
|
|
|
|
 |
|
 |
Dear sir,
I want to display a tree of groups and subgroups. This tree script is good for small numbers of groups but not well if there are a huge number of groups around 2000.
I gives an error 'A script on this page is causing Internet Explorer to run slowly, if it continues to run your computer may became unresponsive.
Do you want to abort the script ?'
The above message is display,
is there any solution...
sanjeev dhiman
sdhiman@coecipl.com
Sanjeev Dhiman
Software Engineer
NOIDA, India
sdhiman@coecipl.com
|
|
|
|
 |
|
 |
hi how it is going i used the script and it is very good but i wanna the tree to be drawn in a specific location inside a td i don't want it to be at the left of the document so how i can do this
|
|
|
|
 |
|
 |
i think i found the solution that is by selecting another element by its id and it works with td not table
|
|
|
|
 |
|
 |
I insert a table and to rootCell variable assign :
rootCell=tblMenu.cells(0);
Note:
"tblMenu" is the name of the table,
I hope you understand me, bye
|
|
|
|
 |
|
 |
Very nice script. But for those trying to remove the expansion sign in front when an item has no children. After adding all of your nodes, just run this function (just an adaption of toggle() without the toggle)
function TestIcons() {
var idx = -1;
for( i = 0; i < iconList.length; i++ )
{
item = iconList[i][0];
if (item) {
idx = i;
var div=document.getElementById("D"+item);
var key=document.getElementById("P"+item);
// Check if the item clicked has any children. If it does not then remove the plus/minus icon
// and replace it with a transaparent gif.
var removeIcon = div.hasChildNodes() == false;
if( key != null )
{
if( removeIcon )
key.innerHTML="<img src='transparent.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
}
}
}
}
|
|
|
|
 |
|
 |
Where do you place the function call?
|
|
|
|
 |
|
 |
You should call TestIcons() at the end of the CreateProjectExplorer function as shown.
function CreateExplorer() {
Initialize();
CreateTreeItem(); //however many times you call it
TestIcons();
}
Then call CreateExplorer() in the body OnLoad.
|
|
|
|
 |
|
 |
Yes, that is what I thought. It appears that this only works in latest versions of FireFox and does not work in IE 6. I'm not sure why it does not work. I tried on two different machines running WindowsXP SP2 + IE6.
Thank-you for the reply.
|
|
|
|
 |
|
 |
Okay, I've updated the code so it now works in both Firefox and IE 6, I cannot vouch for older versions of either, but at least with the latest items, this version should work.
function TestIcons() {
var idx = -1;
var item = false;
for( i = 0; i < iconList.length; i++ )
{
if (iconList[i].length != 0) {
item = new String(iconList[i][0]);
}
if (item) {
idx = i;
if( idx < 0 )
alert( "Could not find key in Icon List." );
var div=document.getElementById("D"+item);
var key=document.getElementById("P"+item);
// Check if the item clicked has any children. If it does not then remove the plus/minus icon
// and replace it with a transaparent gif.
var removeIcon = false;
if (div.hasChildNodes() == null || div.hasChildNodes() == false) {
var removeIcon = true;
}
if( key != null )
{
if( removeIcon )
key.innerHTML="<img src='transparent.gif' width='16' height='16' hspace='0' vspace='0' border='0'>";
}
}
}
}
|
|
|
|
 |
|
|
 |
|
 |
Hello.
Thanks a lot for the tree, it works well.
But there is some things that I don't like, isn't it
possible to remove (from the beginning) the plus image icon from
nodes wich don't have child nodes (I've noticed that you do so when
the node is clicked), and I have one more comment regarding this, also
when the node doesn't have any child nodes then by clicking it the
image icon which indicates for ex. that folder is open must not appear, because it doesn't have any childs (it seems same problem as with plus
icon) Also, is it possible to make this tree open travesed from the beginning
(I mean when the tree, page is opened the child nodes are already opened, is yes please help me, how I can do this)
Thanks in advance.
David Gevorkian (davidgev@lycos.com)
|
|
|
|
 |
|
 |
Thanks for your help, one more question:
how do we get the vertical lines to appear with Tree View?
|
|
|
|
 |
|
 |
That is more tricky, but achievable.
You will need to change how the nesting works. At the moment it just uses padding when the DIV is created for the child with the CreateDiv() method. The line that controls the indentation of the children is: div.style.marginLeft = "2em";
Change this value to "5em" and "0em" how it works.
To also better understand the nesting change the value of the border attribute in the CreateTreeItem() method.
table.setAttribute( "border", 1 );
Once you have done this you will see how the nesting works and then it will be self evident as to what you need to do.
But, in a nut shell, in order to get the vertical bars you will need to reduce the padding to zero and create a new TD in each TR for every level of indentation. Then assign the cell an image.
When playing with this I suggest you keep borders visible so you can see what is happening.
Bryon
|
|
|
|
 |
|
 |
Excellent code for Tree View, but we get an error when we want to expand Tree View automatically (the error is in line 80 of tree_view.js, key not recognized). Can someone send us an example with Tree View Expanded?
|
|
|
|
 |
|
 |
The reason you are getting the error is that the Expand() and Collapse() methods are old ones that I forgot to delete. They won't work as they stand.
The way Tree View works is that is creates a hash that uniquely identifies every node. When you click on the expand or collapse symbols (+ or -) the hash is passed so that it can work out which one needs to be expanded or collapsed.
You need to modify the Expand and Collapse methods to pass these hash keys.
Regards,
Bryon
|
|
|
|
 |
|
 |
good work
How to see lines on ur stuff
|
|
|
|
 |
|
 |
and also where is the provision to store value for particular node
|
|
|
|
 |
|
 |
Good treeview. Question: how do you set to expand a default tree node intialially upon creation?
|
|
|
|
 |
|
 |
Change the CreateDiv() method to be:
// Creates a new DIV tag and appends it to parent if parent is not null.
// Returns the new DIV tag.
function CreateDiv( parent, id, expand )
{
div=document.createElement("DIV");
if( parent != null )
parent.appendChild( div );
div.setAttribute( "id", "D"+id );
if( expand == true )
div.style.display = "block";
else
div.style.display = "none";
div.style.marginLeft = "2em";
return div;
}
Add another parameter to the CreateTreeNode() and pass it down the chain.
There is an old Expand() method that I forgot to delete. It will almost do what you want. With a small mod, if you call it it will expand the entire tree.
Regards,
Bryon
|
|
|
|
 |
|
 |
Tankx,very nice treeview,
i used AJAX to make it more dynamic
|
|
|
|
 |
|
 |
i too have similar requirement , when i click particular node i should populate some other nodes from server (i am using script callback instead of AJAX) , so for this i need to assign some particular value for nodes , can u help on this
Thanks
Sudhakar
|
|
|
|
 |