ActionScript 3.0 :: Flex Delete A Tree Node Having A ArrayCollection As Data Provider

May 20, 2010

I have a Flex tree with an ArrayCollection as data provider. The ArrayCollection is composed by objects linked eachother by the "children" field (that is an Array containing other children objects)

[Code]...

View 1 Replies


Similar Posts:


ActionScript 3.0 :: ArrayCollection As Tree Data Provider

Mar 11, 2009

I have been trying to populate a tree control via an httpservice that uses php to talk to a database. The queries work fine and the data comes back in the following format from php:
echo "<root>";
echo "<topic>";
echo "<sectioncode>$sectioncode</sectioncode>";
echo "<children>";
echo "<labtitle>$title</labtitle>";
echo "</children>";
echo "</lab>";
echo "</root>";

Flex can see this and interprets the heirarchy fine unless i try to format the resultformat in the httpservce (if i do that it goes a little nuts). The results from the php query to the db come back as an ArrayCollection with each containing a "root->topic->sectioncode->title" type of structure (which is what I want). When I go and try to use this Arraycollection as a dataprovider for a tree control, it doesn't work at all. When I use the arraycollection as the dataprovider I get [object,object] for every row in the tree and there is no parent/child structure.

Ideally I would like the title to be a child of the numbercode, but when i try and format the return from xml like that the number becomes and object without a value and the title becomes a child. I have a feeling that I am missing something in the php return to show the structure to flex more clearly and also something in the tree to implement it as the data provider better. Here is the code that I am using in the tree:
<mx:Tree x="25" y="48" height="451" id="ilabtree" dataProvider="{labarray}" labelField="@title" width="152" textAlign="center"></mx:Tree>

View 1 Replies

Flex :: Filter The Data Provider For A Tree?

Mar 23, 2012

I have a requirement to filter the tree similar to that of flex builder-->preferences wizard tree.

My tree dataprovider is arraycollection of industries. Each industry has a list of sub industries and further, say upto depth 5.

So when we type in a string to filter, only the node having this string along with their parent hierarchy should be returned.

How can we implement this using flex?

View 1 Replies

Flex :: Hide The Last Children Of An XML Data Provider (not To Be Displayed In Mx:Tree)?

Apr 6, 2010

I have an hierachical XML data, and I want to display it as a tree. The XML data is something like this:

<services>
<service name="TestService" endpoint="">
<method name="sayHi">

[code].....

View 1 Replies

Flex :: Actionscript 3 - Delete Node Of Type Object From Flex Tree Component?

Feb 11, 2011

I have a tree with nodes , and a delete button , first user select the node and click this delete button , I want this node to be removed from the tree , Its not XML , every node in tree is of type Object

{label:'folder',children:[{label:'file1'}]}

I tried delete myTree.selectedItem (but compiler wont let me do it) also tried myTree.selectedItem = null (just unselects the item)and also how can I access reference to parent object of myTree.selectedItem ?

View 3 Replies

Flex :: Get The Item Parent In A Tree When Using Nested Objects As Data Provider?

Jan 11, 2010

I have a Flex tree with an ArrayCollection as data provider. The collection holds an array of CategoryVO objects. Each object can have another array of CategoryVO objects inside it's "child" attribute. This way the tree displays the data correctly. Now I want to get the parent of a specific item, e.g. tree.selectedItem. Using XML as data provider the item parent is avaiable thorugh the parent() method. But I can't convert my data to XML. How can I get an item's parent? Perphaps using the tree's dataDescriptor?

View 2 Replies

Flex :: Conditional Data Provider To Tree On The Basis Of List Selection?

Aug 1, 2011

This is my XML data in a file named nodesAndStuff.xml.

<?xml version="1.0" encoding="utf-8"?>
<root>
<node label="One" />[code].........

Now I have added my tree just below the list and I have saved counting from 10 to 19 in one.xml, 20 to 29 in two.xml and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list

View 1 Replies

Flex :: Flash Builder - Data Provider Not Working If XML Has Single Node Value Or Less

May 20, 2010

i get this error when i retrieve an XML that only has 1 node (no repeating nodes) and i try to store in an ArrayCollection. -When I have MORE than 1 "name" nodes...i do NOT get an error. My test show that XMLListCollection does NOT work either.

TypeError: Error #1034: Type Coercion failed: cannot convert "XXXXXX" to mx.collections.ArrayCollection.

this error occurs as the line of code:

myList= e.result.list.name;

Why can't ArrayCollection work with a single node? I'm using this ArrayCollection as a dataprovider for a Component -is there an alternative I can use that will take BOTH single and repeating nodes as well as work as a dataprovider?

code:

[Bindable]
private var myList:ArrayCollection= new ArrayCollection();
private function getList(e:Event):void{
var getStudyLoungesService:HTTPService = new HTTPService();

[Code]....

View 3 Replies

Flex :: Populate Tree Using Data From ArrayCollection?

Apr 6, 2010

Let's say I had an ArrayCollection like this:

public var ac:ArrayCollection= new ArrayCollection([
{item:"dog", group:"Animals"},
{item:"orange", group:"Fruits"},

[Code]....

How would I create a Tree component in Flex 3 that uses the groups as nodes, with the appropriate items listed under each node?

View 2 Replies

Actionscript 3 :: Filter Arraycollection With Selected Tree Node?

Nov 21, 2011

I have a window with a tree (each node is a category). I have a dataprovider what contains picture url and category. My goal is to filter the view with only selected node. Several nodes may be selected in the time.

View 1 Replies

Actionscript 3 :: 4 - Expand Children Of A Tree With Non-XML Data Provider

Feb 7, 2011

I have a tree using an ArrayCollection/Object data provider. The following code worked with an XML data provider but won't work with the non-XML data provider:

[Code]...

View 1 Replies

Flex :: Events - AdvancedDataGrid Tree DropParent - Drag A Leaf From One Node To Another Node

Jan 14, 2010

I have an AdvancedDataGrid tree with a ArrayCollection as its dataprovider. Now, for instance, i drag a leaf from one node to another node. To catch the event I'm adding a Listener to dragComplete.

[Code]...

My Problem: I want to know the new node where the leaf was dropped. Actually i would have expected that in the event there is a property like dropParent. This is not the case.

View 1 Replies

Flex :: Select A Node In Tree Based On XML Node Property?

Jan 18, 2011

I have a tree im my mxml that uses a XMLListCollection as dataProvider. Itīs XML is like:

<list>
<conta nome="Plano de Contas" id="1">
<conta nome="Creditos" id="2" />
<conta nome="Vendas" id="4" />

[code]....

How can I make the node for, say, id==4 visible AND selected?

View 2 Replies

Flex :: Datagrid - ItemRenderer Flex Values Getting Not Rendered According To ArrayCollection Provider?

Feb 4, 2011

i have a problem using the itemRenderer functionality. When using an ArrayCollection the visible Data in the DataGrid using the itemRenderer will be rendered just fine. But if i start scrolling the entries are repeating in the cells using the renderer. The cells are not filled with date according to the id. What mistake i'm doing here.

I read a lot of the explainations like:

[URL]

here is the code for the set data function (itemRenderer is extending HBox):

override public function set data(value:Object):void {
_data = value;
if(data!=null)

[code]....

View 1 Replies

ActionScript 3.0 :: Flex Data Grid - Update Column With Variable (not From Data Provider)?

Jul 27, 2009

I have a data grid who's data provider is set to an XML object.

Code:
<mx:DataGrid id="streamMonitorGrid" dataProvider="{_data.stream}" height="100%" width="100%">

[code].....

View 5 Replies

Flex :: Update Hierarchical Data Provider In Advanced Data Grid During Drag And Drop?

Nov 11, 2010

I am trying to drag and drop hierarchical data in the same advanced data grid, and I would like the data provider to updated when the ADG is updated. (I want to be able to save and load this tree, so it is important that drags and drops are saved.)

[URL]

The sample app has an ADG showing hierarchical data as well as flat data. The first column of each datagrid shows the rowindex of the underlying data.

If you rearrange the items on the left ADG, the row indexes become unordered. If you click traceTree you see that the data provider is not in order.

On the other hand if you do the same on the right, the row numbers stay ordered even when the objects move around and if you click traceFlat, the data provider is in the order shown on ADG

My goal is to have the data provider order match the ADG order for the left grid which is displaying hierarchical data.

View 1 Replies

Flex :: Data Grid Crashes With Data Provider Change?

Oct 5, 2010

I have a radio button group within a data grid, whenever I attempt to change the selected radio button the web page crashes. Below is how I put together the radio button in the data grid.

MXML

<mx:Accordion>
<fx:Declarations>
<s:RadioButtonGroup id="cover"/>

[Code]....

View 2 Replies

Flex :: Flex4 - How Many Childs In Arraycollection With Same Node

Mar 30, 2012

I have an ArrayCollection which has several employees and departments.Each employee belongs to one department. How can I find out how many employees are belonging to the same department from the said ArrayCollection.In database we use join query to do this, but how can I do this by using an ArrayCollection in Flex?

For Example

[code]...

How can i fetch these values from arraycollection in flex? is there in inbuild function or property provided by adobe.

View 4 Replies

Flex :: Adding A Node To Tree?

Sep 10, 2009

[Bindable]
private var company:XML =
<list>

[Code]....

The Particular code adds a new node to the operations, but i want to add a node any item i select.

View 2 Replies

Flex Tree Node Types?

Sep 6, 2010

i have a tree of nodes that i dont want some type of nodes to appear in the tree, i can check the data on tree item renderer for each specific node type, so i have one type that i dont want it to be shown as tree node, like it doesn't exist.

if(this.data.type == TypeEnum.id){
this.visible=false;
this.height = 0;
}
else {

View 1 Replies

Flex :: How To Wordwrap In Tree Node

May 22, 2009

I have a Tree object in my Flex code. It's width is 100%, and it is contained by a Panel with width=200. I am using a custom itemrenderer that extends TreeItemRenderer.I need the text in each node to word wrap if it's too big (as happens often). I have triedlabel.wordWrap = true;

View 5 Replies

Flex :: Same Data Provider For Chart And Data Grid?

Aug 18, 2011

I want to display the same data in a chart and a data grid. I want to use the same data provider for both of them to reduce the amount of SQL queries.How do I transform the database structure into the chart structure and into the table structure using ActionScript?*

Database structure in JSON format:

[
{key:, year:, value:},
{key:, year:, value:}
]


Data provider structure required by a chart:

[
{series1:, series2:, year:},
{series1:, series2:, year:}
]

Data provider structure required by data grid:

[
{key:, year2000:, year2001:, ...},
{key:, year2000:, year2001:, ...}
]

View 1 Replies

Flex :: Accessing Node In ArrayCollection Based On Variable Value

Nov 2, 2010

I need accessing a value in my arrayCollection in Flex 3.
var f:String;
I need to access the photoFilePath where series = f. So if f=2, then I need /pics/my2.png
So, pseudo code: myAc.(series="f").photoFilePath
<mx:ArrayCollection id="myAC">
<mx:Object label="Label 1" series="1" photoFilePath="/pics/my1.png" pageTitle="First"/>
<mx:Object label="Label 2" series="2" photoFilePath="/pics/my2.png" pageTitle="Second"/>
</mx:ArrayCollection>

View 1 Replies

Flex :: Add A Node To Tree Without Adding It To DataProvider?

Feb 23, 2010

I've got a couple trees that I allow a user to drag and drop from one to another, works great except one apparent limitation. I'm picking up where they drop it in the list and adding it to the dataProvider manually. The user can drop it everywhere except after the last child of any particular node it seems, since it reads that position as being between the node and it's next sibling.

It seems the best way to deal with this is to add something like a dummy leaf so the user has something to drop the item in front of. I don't want this leaf in the dataProvider, so is it possible to add a leaf (or a folder) to the tree without adding it to the dataProvider?

View 2 Replies

Flex :: Add An Indicator On A Tree Node Icon?

Nov 17, 2010

I want to add an indicator on a tree node icon , meaning , for example like in eclipse when there is an error the icon get a special small indicator on the regular icon. how can i do that?

View 1 Replies

Xml :: Flex - Delete XML Node - Keep Original

May 31, 2010

I need to delete some nodes from an XML variable and I want to keep the original intact. So I pass the XML to a new variable and delete the nodes from that one but the original changes with it. Is there a way to protect the XML from the original variable?

View 1 Replies

Flex :: Override Child Node Controls In A Flex Tree Control?

Aug 20, 2010

I am currently developing a dynamic LineChart in FLEX 4.I am implementing a Tree control next to my LineChart, which will filter the LineChart dataprovider and lineseries. The tree control has several branches and ultimately 5 children (leaf nodes) at the bottom of the last branch.I need the leaf node/children to be displayed as checkboxes inside the tree control.As I understand,this will require overrides in the TreeItemRenderer class.This is where I am a little confused on how to implement that.Currently I can distinguish between leaf and branches using this code, in my main MXML component.I added this because it may be helpful to some beginning FLEXdevelopers, such as myself, who cannot easily find this functionality documented well:

private function treeClick(e:ListEvent):void {
_selectedItem = Tree(e.currentTarget).selectedItem;
if(mainTree.dataDescriptor.isBranch(_selectedItem)) {[code].....

I am looking at the TreeItemRenderer override class from the following example here: In the example, they override the "createChildden" super function to add checkboxes to the tree control.My question is, can I override the createChildren function directly in my MXML component, and not have to use an entire class file to override this functionality? Must I re-invent the wheel to do this?Also, how can I distinguish that my treeItem is a leaf node and not a parent, in the override function? I only want to add checkboxes to the leaf nodes, how can I differentiate? The following example adds checkboxes to all branches and leaf nodes, but I want to add checkboxes only to leaf node/children. How would you approach that?

override protected function createChildren( ): void
{
super.createChildren( );[code]............

Here is my tree tag:

<mx:Tree id="mainTree" dataProvider="{treeData}" itemRenderer="TreeCheckBoxItemRenderer" labelField="@label" showRoot="false" width="100%" height="100%" itemClick="treeClick(event)" />

View 1 Replies

Flex :: Tree Control Get The ItemEditorInstance Of A Just Added Xml Node?

Jan 27, 2010

I have a Tree Control on which I let user add some nodes. When a node gets added I want to let the user edit the added control right away. How do I get the itemEditorInstance of a just added xml node?

View 1 Replies

Actionscript 3 :: Using Flex Combobox To Select A Tree Node?

Oct 26, 2010

I'm using a flex combobox component in Flex builder 3 with sdk 3.4 and I'm trying to use it to expand and select the tree node that the user selected in the combobox component on the change event. However, I'm getting an error when I go to assign the combobox seletedItem to the tree selectedItem. Can you please help? What am I doing wrong?

[Code]...

View 1 Replies

Flex :: Make A Copy Of A Tree From The Root Node?

Feb 16, 2011

I have inherited a Flex air project and have not worked with trees before. The tree is displaying an xml file hierarchically. The user can make a change to the data. I need to save the data of the entire tree to a file.I can save the currently selected item to a file, no problem. But I need to save all the data from the root of the tree, forward.I would think I could make a copy of the tree, and set the selected item of my new tree to root, or something. Sort of like this pseudo code:

var treeToSave:Tree = new Tree (editedTree);
treeToSave.selectedIndex = 0;
// now save treeToSave to file...

This creates a compile error, but hopefully you can see what I'm trying to do.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved