Flex :: Populating Array Collection By Parsing String
Jul 26, 2010
In ActionScript I have string as
str="subject,r1,r2:a,b:1,2:3,4";
Dynamically I have split this string and build array collection as given below
arraycoll.addItem({subject:a ,r1:1,r2:3});
This example of one set. The array collection should be built dynamic. I have tried but not successful.
I have an external .txt file that contains data some variables with strings in them. I need to be able to tell if a string has a certain type of character in it. Like for example "no,yes"I want to detect the "," and split that string up at that point and assign the "no" and the "yes" to variables.Similarly if I have the string"1-100" or 1-2-3-4-5-6-7I want to detect the "-" and split that string up at that point and assign the "1" and the "100" to variables or 1-2-3-4-5 to variables
I have a flashVar variable that is coming into Flash, its URL encoded but I have already decoded it. My problem is I want the set of variables to be pushed into an array.
In my flex application im using two datagridfirst datgrid is for items collectionssecond is for bank details.if i click one row in first datagrid (which has the items collections)...a unique code is taken from the grid(which is primary key).then, i have to select two or more banks using itemrenderer checkboxes in second datagrid(which has the bank details)ow, have to bind the bank details(one or more banks) with that one primary key in first datagrid. to an single array collection... and have to show it in another new datagrid(thirdone)
I have an array, crewPositionsAC that contains a list of position abreviatations - EP, PR, DR, WR, and so on. These positions are read in through an XML file each time my flex application loads. Also being populated from an XML is a project. Within a project, there are positions (a student assigned to a type of position listed within crewPositionsAC). These positions are not necessarily in the correct hierarchy order dictated by crewPositionsAC. I have all the positions within an ArrayCollection (positionsAC) with the following structure:
Then, the user can click a button to add another position. When the "Add Crew Member" button is pressed, the user is presented with a list of possible positions to add. Currently, I simply add another array to positionsAC. This results in the recently added crew member to placed on the bottom of the list. I need to take positionsAC and reorder it based on it's [2] item (role) based on the hierarchy defined in the crewPositionsAC. crewPositionsAC has the following structure:
crewPositionsAC: [0] = EP [1] = PR [2] = DR [3] = WR
* continue until all possible position types are listed
where the component before / represents parent and the children of the corresponding parent are separated by , Can anyone provide me the logic to create a array collection for this hierarchy to set as dataprovider to my tree.
I have an array collection of strings and integers (which I have displayed in a data grid) and I am wondering if it is possible to export the array collection into an html table? or even a text file for the user to download
I found some pages that had an export to .xls files but I want to stray away from that for now.
While making my choice b/n Array and Arraycollection I get confused why whould I use one and why not another. I have read the theory in langref but apart from that is there some general advantages/disadvantages of one over the another that you have learned from your experience.
Im trying to populate a tree control with an external xml file brought in via arraycollection but i need to group the xml data to display in the tree Okay my external xml file is called parts.xml and it looks like this:
[Code]...
additionally what i intend is for the user to have huge tree of parts and they select a node at the partnumber level and drag an drop it on to a datagrid where all the other tags of the part gets displayed.
Ive tried and tried many things without any luck. even now im thinking maybe if i looped through the array-collection and created a new array just for the tree to get it to display the way i need it, then when the user dragged and drop a part onto the grid i would have code that would look for that part number in the original arraycollection and add it to a new array just for the datagrid... i still dont know how i would create that new array for the tree!! cause the xml data is grouped by partgroup and then grouped again by parttype before you get the individual part numbers
I have an array collection that I would like to limit to say 100 items. I tried setting up a filter function where the return was:return (myAC.getItemIndex(item) > 100);but the value was always -1. For whatever reason it couldn't find the item, even though the item is definitely there.I'm able to do this with a while loop:while(myAC.length > 100) myAC.removeItemAt(100);
I have two xml files, defect. xml and employee.xml. But the files havea common field but with different names in each file. I want both the files to be merged in to a single array collection.
The structure of my defect.xml file is:
<defectList> <defect> <revId>123</revId>
[Code]....
Now, if I give datafield as "employeeId" in the datagrid with defectList as dataprovider, I get the employee id of the corresponding Employee Name.
I've got an XML Doc loaded in. I've created an Horizontal List and referenced the arraycollection as the Data Provider. But what I need to do now is then pull the data out from that. I have 3 nodes / variables. They are id, title, thumbnail. But when I go to pull through the data as : {videos.title} Flex Builder gives me the Error - "Access of undefined property videos". Now I know full well it exists, as when I set the dataProvider to {videos} it pulls through the data without issue.
My code is as follows : <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="[URL]" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="800" minHeight="600" [Code] .....
How do I go about getting the XML Node : title and of course the thumbnail too?
I have an array collection set as a datagrid's dataprovider. I'm pulling content from my relational database and 2 of the columns in the grid appear as foreign keys.
How do I go about replacing the foreign key id with information from the other table?
I'm guessing I need to do some sort of: for each, but I'm really not sure how.
I want to sort an array collection in a way that I am not sure is possible.Usually when you want to sort you have something like this.[code]if a is the same in multiple classes then I want to sort on ToSortInner2.aa Is this possible. I have tried to pass in inner1.aa as the sort field name but this does not work.
I'm using zend_amf and flex. My problem is i have to populate my advance datagrid using array collection. this array collection have a children.[code]...
I want to give an array index to array collection let say 205 when it is started is it possible to do so in flex or any alternate of this.actually I need to index the objects with a specific no, in 2D array collection
say
205 a c d g f d 268 s g h g f f 805 d g h h f f d
where integers are indexes and alphabets are object referenced by these integers
I am trying display values in a datagrid in my application. I have all the values as an xml file. I had only one set of record n the XML file, to fill only one row of the data grid. While trying to store the values from the XML file to an Array Collection in the application File using the code, i.e.,
I get an error, saying Error No# 1034: Type coercion failed cannot convert mx.utils::ObjectProxy to Array.But If I have two record sets in the XML file, it works fine. If there is only one set, I gHere is my xml file:
I have an array collection as the dataprovider to a datagrid. When I change a value in the arraycollection, a particular row gets updated in the datagrid. I want to get the index of that particular row. How do I get it?
I have an advanced data grid. The data provider for this ADG is an ArrayCollection. There is a grouping collection on an ID field of this AC. Example of a couple items within this AC the AC var name is "arcTemplates":
(mx.collections::ArrayCollection)#0 filterFunction = (null) length = 69 list = (mx.collections::ArrayList)#1
[code]....
Problem: In my AC example there are a few items, items 0, 32 and 56 properly sort and group to their templateTypeID, but item 55 does something weird. It seems to sort/group on the numeric 5 instead of the string "5". Gets stranger. If I change the name property to contain text (so 1234x) it then correctly sorts/groups to the string "5"
I have an arrayCollection with the following structure:
[Code]...
the AC is defined as follows:[Bindable] private var projectErrorsAC:ArrayCollection = new ArrayCollection;
I'm using this AC in a repeater to display each error. After each error is shown, I've placed an "Accept" and "Deny" button. Once the user clicks either one of these buttons, I'd like to call a function that removes the particular error from the AC. Here's what I have so far:
I'm trying to find a way to parse out some numbers from a potential string. Basically, I'm making a financial-based calculator, and the user could input something like
$45,509.30
and I'm trying to figure out how to extract everything but the period so I'm left with
45509.30
I found this help from Senocular: [URL]
But unfortunately, it's AS1 and I can't get it to work with my code...t