Embedding Tree control in TableView
Hi all,
I want to create a table which rows can be collapsed, looks like a tree embedded into a table.
But we do not know how to implement it using Portal Applications. Can anyone send an example to do it?
If I use CellRenderer to render tree control,After expanding the tree node,the subnodes are displayed in the same cell.But what I need is ,on expansion of tree the rows also should be expanded and collapsed accordingly.
Thanks in Advance,
Santhosh
Hi Santhosh,
Actually there is no need to use div tag. I am giving a sample code below. Try it and make the necessary modifications.
<html>
<head>
<title>
Expand/Collapse
</title>
<script language='javascript'>
function toggle(divid)
obj=document.getElementById(divid);
visible=(obj.style.display!="none");
if(visible)
obj.style.display="none";
else
obj.style.display="block";
</script>
</head>
<body>
<table border=1>
<tr>
<td><a href=javascript:toggle("first")>First</a></td>
</tr>
<tr id="first" style="display: none;">
<td><b>This is the first text</b></td>
</tr>
<tr>
<td><a href=javascript:toggle("second")>Second</a></td>
</tr>
<tr id="second" style="display: none;">
<td><b>This is the second text</b></td>
</tr>
</table>
</body>
</html>
Hope this solves your problem.
Ranjith
Similar Messages
-
How to render image in tree control without embed it
Hello frndz i am working on tree control and want to show imagein its node through xml list collection.i have searched a lot for this but in every example with tree control images are embeded.i dont want to hardcode the image.Need to make the image comes from database(Xml).so is there any live or demo example for tree control.
Thanks in Advance
Vineet oshoif you decompile the imaging.ear file, there is a web.xml file which you can add the following parameter:
<context-param>
<param-name>oracle.adf.view.rich.security.FRAME_BUSTING</param-name>
<param-value>never</param-value>
</context-param>
or take a look at Receiving "Warning: Unable to load content in a frame. Frame content will load at the top level." When Trying to Use the <af:inlineFrame> Component [ID 1266770.1] on Oracle Support.
Make sure you take a copy of the imaging app before you make changes. You can then upload back through the weblogic console.
Sudi -
AS 3.0 & WebService & Tree control Bind to hierarchical data?
What is the trick to get the results of a call to a
webservice that returns a hierarchical XML SOAP document to map
directly to a Tree Control's dataProvider property?
In the debugger, I can see that lastResult is an ObjectProxy
which has a couple of properties and one of them is an
ArrayCollection as I expect. However, I can't figure out how to use
this result with a Tree control and the dataProvider property so
that I can navigate thru the hierarchy returned.
TIA
GeorgeYeah this is using the embedded scripting. I need to change this to show the final sql vs. the script that is being used.
-kris -
Hi,
i need to add a picture on the tree control. i have attached a image file for reference. i need to bring a tree control of that form. Can some one help me to achieve it.
Padhu
Attachments:
Tree Picture.jpg 10 KBsee here
Vix
In claris non fit interpretatio
Using LV 2013 SP1 on Win 7 64bit
Using LV 8.2.1 on WinXP SP3
Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
Using CVI 6.0 on Win2k, WinXP and WinXP Embedded -
How I can do for change the folder icons of the tree for a
new ones? I want to change the the folder icons of the
ListCollection for another kind of images and not the default icons
like folders images in the tree.
Regards,
<mx:Tree x="10" y="10" width="161" height="298"
id="TreeProject" labelField="@label" showRoot="true">
<mx:XMLListCollection id="ProjectTree">
<mx:XMLList>
<folder label="Home Page">
<folder label="Slide Show"/>
<folder label="Other Folder">
</folder>
</folder>
</mx:XMLList>
</mx:XMLListCollection>
</mx:Tree>evsPeart,
You can change the default icons by setting the
"folderOpenIcon" and "folderClosedIcon" styles on the Tree control.
To change the leaf icons, set the "defaultLeafIcon" style (see
attached code for a simple example using embedded images).
Peter -
How can I display and change built-in symbols of a tree control programmatically?
I want to set the built-in symbols of a tree control during runtime.
I only found an example to assign custom pictures but not how to select one of the 40 built-in symbol.
Many Thanks
Solved!
Go to Solution.The ActiveItem.SymbolIndex will allow you to select the symbol for the active item. You can use the ListBox Symbol Ring Constant (Dialog and User Interface palette) to select a symbol (or you can just enter the number directly if you know what it is).
Message Edited by smercurio_fc on 07-10-2008 09:36 AM
Attachments:
Example_VI_BD6.png 2 KB -
Not able to get the database data into the Tree Control
Hi Everybody,
I have to populate the tree control with nodes and items, which is to be populated from the database, and the tree control is <b>dynamic</b>. I mean, there is a <b>toolbar</b>, whenever a <b>pushbutton is clicked</b>, depending on that the tree contents has to be changed.
If anybody had worked with <b>CL_GUI_COLUMN_TREE</b> control to get the data from database, depending upon the <b>pushbutton selected in Toolbar</b>, please paste the seudocode for it.
Regards,
Abdul,
Intelligroup.
P.S: Helpful answers will be rewarded.have you seen this demo program
SAPCOLUMN_TREE_CONTROL_DEMO
Regards
Raja -
How to get all items under a parent item in a tree control
Hello,
I have 2 questions regarding a tree control:
1) Is there any way to specify a parent item tag and get an array of ALL its sub item tags? For example, in the attached vi, specify the Parent#2 parent tag and get an array containing Item#P21 and Item#P22
2) Is there a way to specify a range to the ActiveCell property. For example, all items from line#1 to line number#3
Any ideas?
Attachments:
Tree example.vi 6 KBMentos wrote:
1) Is there any way to specify a parent item tag and get an array of ALL its sub item tags? For example, in the attached vi, specify the Parent#2 parent tag and get an array containing Item#P21 and Item#P22
Did you try a search? There's no direct way of doing this. You have to navigate the tree and build up an array. You can find an example here: http://forums.ni.com/t5/LabVIEW/get-all-children-of-a-parent-in-tree/td-p/729548
2) Is there a way to specify a range to the ActiveCell property. For example, all items from line#1 to line number#3
No. (It's called ActiveCell, not ActiveCells) Presumably you are trying to perform an operation on multiple items. Unfortunately, you need to use a loop. You should defer panel updates if you're doing this a lot. -
How to binding incoming xml node list to the tree control as dataProvider
Recently, I faced into one issue: I want to binding incoming xml node (it's not avaliable at start) list to the tree control as a dataProvider.
Since the incoming xml node list is not avaliable at beginning but I needs to bind it to the tree, so I create one virtual one in the xml, and prepare to remove it before the tree is shown. (ready for the actual node adding). But It did not work.
Please see the presudo-code here:
1. Model layer(CsModel.as)
public class CsModel
[Bindable]
public var treeXML:XML=<nodes><car label="virtualOne" id="1">
</car></nodes>;
(Here, I want to build binding relationship on the <car/> node,
one 'virtual/stub' node is set here with lable="virtualOne".
But this node will be deleted after IdTree
control is created completely.)
[Bindable]
public var treeData:XMLList =new XMLListCollection(treeXML.car);
2. view layer(treePage.mxml)
private var _model:CsModel = new CsModel();
private function addNode():void
var newNode:XML=<car/>;
newNode.@label="newOne";
newNode.@id=1;
_model.treeXML.appendChild(newNode);
private function cleanData():void
delete _model.treeXML.car;
<mx:VBox height="100%" width="100%">
<mx:Button label="AddNode" click="addNode()" />
<mx:Tree id="IdTree" labelField="@label"
creationComplete="cleanData()"
dataProvider="{_model}"/>
</mx:VBox>
3. Top view layer (App.Mxml)
<mx:application>
<treePage />
</mx:application>
For method: cleanData(),It's expected that when the treePage is shown, we first delete the virutalOne to provide one 'clear' tree since we don't want show virtualOne to the user. The virutalOne node just for building the relationship between treeData and treeXML at beginning. But the side effect of this method, I found, is that the relationship between treeXML and treeData was cut off. And this leads to that when I added new node (by click the 'addNode' button) to the xmlXML, the xmlData was not affected at all !
So Is there any other way to solve this issue or bind the incoming xml node list to the xmlListCollection which will be used as Tree control's dataProvider ?If u want to display the name : value then u can do like this
<xsl:eval>this.selectSingleNode("name").nodeName</xsl:eval> : <xsl:value-of select="name" /> -
How can I save the all the values of a tree control ?
I have a problem, in run time, I adds new items on a tree control, but i don´t know how I can save the values of the child text of each item in a file.
Thanks.I'm no expert on the tree control, but I made a small example to save all items to a textfile, including item tag, item string, and indent level. One drawback of this method is that it fully expands the tree regardless how the user left it. To go the other direction, you'd have to write a routine to go through the text file and programmatically build the tree.
To master the tree control, I think you have to resort to creating a control reference for it and using the Invoke Node to do some operations. For another approach to traversing and operating on a tree, check out the "Traversing Tree Controls and Setting Custom Symbols" (search the NI Developer Zone site).
Best of luck,
John
Attachments:
Save Tree Structure to Textfile.vi 32 KB -
How can I drag and drop an item from one Tree control to another in LabVIEW 7.1?
You can use the mouse up and down event on the two tree controls but the problem is making the correct selection in the second tree control. I want to be able to switch over to the selection bar of the second tree control so that I can place my item in the correct position. I know all possible workarounds with double-clicks and so on... but I really want a windows drag and drop.
This is what I have for the moment. Please check the library below. I need to activate the selection bar of the second tree control somehow to get the position in the control. The VI below is written in LV 7.1
Attachments:
Drag&Drop.llb 65 KBHi Jones,
As far as I know this feature is currently not supported by the Tree control. A workaround, would be to use the vertical position of the mouse in the button up event to determine what line you�re dropping the item.
If you would like the Tree control to include the drag and drop feature, please submit this as a Product Suggestion under the feedback at www.ni.com/contact.
Good luck!
Best regards,
Philip C.
Applications Engineer
National Instruments
www.ni.com/ask
- Philip Courtois, Thinkbot Solutions -
How to use the drop event of the tree control in LabVIEW 8.20?
Hi,
I am using the two tree controls in my application to provide a option for the user to drag and drop item from one tree to the other. I have to validate the user selection. I tried to capture the user drop event using the event structure. The problem I am facing is, I am not able to drop the item even though i have wired a constant true to the filter(Accepted?) in the event case. I have enable the property(Allow droping) in the right menu of the tree control also.
While configuring an event case for (drop, drag entered and some thing like this) only I am getting the problem otherwise it is working fine.
What do i need to do to caprture the drop event ?
Is there any way to avoid the item duplication while droping a new item in the tree control ?
or how can i do this?
Thanks,
Pandiarajan RHi Pandiarajan,
I hope you are doing well today! There is a lengthy discussion on the Tree Control Drag & Drop feature at this forums post including contributions from the developer of the Drag & Drop feature:
Tree Control Drag & Drop in LabVIEW 8
By avoiding item duplication, do you mean that you don't want the same item to be in the old tree control or do you not want more than one item in the new tree control?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies -
How to get position of a ring in a tree control?
Ok, this is probably a stupid question, but how does one get the position of a ring inside of a tree control? I have a tree with two columns, with rings in the second column. I can set the position using SetTreeCellRingValueFromIndex(), but how does one get the position after the user has modified the control? I found the functions GetTreeCellRingIndexFromValue() and GetTreeCellRingValueFromIndex() but I haven't found a way to get either the Index or the Value of the ring (what I'm looking for is the index, but if I can obtain the value I can go from there). Thanks in advance!
Solved!
Go to Solution.Hi,
You can use GetTableCellVal function to get the value of the ring.
There is not special "ring" function for that. Maybe that's what you were searching for
From the value you can get to the index using the functions you are already aware of.
Hope this helps,
S. Eren BALCI
www.aselsan.com.tr -
How do I get the tag of a selected line in a tree control ?
I am running LabVIEW 7.1.
I want to be able to add a parent or sibling to a tree to a selected item in a tree.The tag of the selected item is actually the output of the tree control itself. If you create an indicator from the tree control, you will get a duplicate tree control (indicator), but if you wire the output into a string indicator, the tag of the selected item will show up. You can an item to the tree by wiring the tree reference into an invoke node, calling the method "Edit Tree Items: Add Item", and wiring the output of the tree control (which will be the tag of the selected item) into the "Parent Tag" terminal. This method will only let you add a child to an item, you cannot add a parent or sibling. Items cannot have multiple parents, so it wouldn't make sense to add a parent; and to add a sibling for the selected item, you could call the method "Navigate Tree: Get Parent" and pass the tag of the parent into the "Edit Tree Items: Add Item" method.
Robert Mortensen
Software Engineer
National Instruments -
Tree control - How to get the full path of selected Item in tree control
I am Flex newbie. When the user clicks the particular item in
the tree control I just wanted to get it name along with it's full
parent.
Here is my XML
var dirXML:XML=<root basename="/home/tcegrid">
<Directories>
<Dir Name=".autosave" />
<Dir Name=".emacs.d" />
<Dir Name="AnsysDistributed">
<Dir Name="opt"/>
<Dir Name="root" />
</Dir>
<Dir Name="postgres"/>
<Dir Name="FineTurbo"/>
<Directories>
</root>
The above XML is data provider for Tree control. When the
user clicks the Dir Name called opt. I wanted it absolute path in
XML. say Directories.Dir.Dir.@Name is opt
Can any one tell me how to get this?"Thamizhannal" <[email protected]> wrote in
message
news:gam9q8$4es$[email protected]..
>I am Flex newbie. When the user clicks the particular
item in the tree
>control
> I just wanted to get it name along with it's full
parent.
> Here is my XML
> var dirXML:XML=<root basename="/home/tcegrid">
> <Directories>
> <Dir Name=".autosave" />
> <Dir Name=".emacs.d" />
> <Dir Name="AnsysDistributed">
> <Dir Name="opt"/>
> <Dir Name="root" />
> </Dir>
> <Dir Name="postgres"/>
> <Dir Name="FineTurbo"/>
> <Directories>
> </root>
>
> The above XML is data provider for Tree control. When
the user clicks the
> Dir
> Name called opt. I wanted it absolute path in XML. say
> Directories.Dir.Dir.@Name is opt
> Can any one tell me how to get this?
loop until the parent() property of the XML node is empty.
HTH;
Amy
Maybe you are looking for
-
When I try to download Creative Cloud on my mac Error Starting Creative Cloud comes up
When I try to download Creative Cloud on my mac Error Starting Creative Cloud comes up message is:cookies dir: cannot make folder/cookies:Permission denied (error 13). What to do?
-
Trying to install FCE HD 3.5 and it fails on LiveType
I am installing the entire package, however, when I get to Live Type Media 1 it fails on 1A after it has gone 69% of the way. I have tried to re-intall/upgrade about six times now.... Please help!
-
What's new between quicktime 7.1 and quicktime7.0 H264 decoder
I have a 264+AAC file, it can play on quicktime version 7.0 correct, when i update quicktime version 7.1, only the first GOP is correct, any body know what different between quicktime decoder version 7.0 and 7.1 ? thx!
-
Interface trip stop not running on ship confirm
Version: 11.5.10.2. Hi Guys While ship confirming the orders, for some of them, interface trip stop is not automatically running which keeps the order status " shipped" and the order does not become eligible for running autoinvoice. We have to unassi
-
Authorization restirction at VL01N
Dear Experts We have 2 dist channels as exports and civil.At VL01N delivery creation level the User should not be able to process the deliveries that belong to Exports Dist channel but can process for civils. Is it possible ? If yes then how?