Flex :: Evaluating String For Datagrid HeaderText?
Dec 2, 2011
I am creating headerText for a datagrid (dgTop250). How do I get the variable headerStr to evaluate correctly in the last line of the function? With the code below I get the entire string as the column header in the datagrid, not the evaluated expression that I need. Variable colName is evaluating correctly. I tried creating an Object of headerStr and using Object.valueOf() in the last line, but got the same result as before.
public function get250(event:ResultEvent):void {
(var i:int = 0; i <= dgTop250.columnCount; i++) {
var colName:String=dgTop250.columns[i].dataField;[code].......
View 1 Replies
Similar Posts:
Mar 9, 2010
I have a Adobe AIR application which has a datagrid. My requirement is to allow the user to make the column headers and the number of columns of that grid, customizable. 1. How can I get the column headerText values from DB? 2. If the user can enter the column names, it has to be saved to the DB and then loaded.
View 1 Replies
Feb 11, 2011
I have a Datagrid that is being populated by an ArrayCollection (rows) of Arrays (columns).I need to update the headerText of each column based on a List that will correspond with the total number of items within each array in the arraycollection. What is the best way of doing this? I know that I can set a listener in the List and update the headerText using (matrixDatagrid.columns[i] as DataGridColumn).headerText but I am looking for a cleaner solution.
View 1 Replies
Jul 15, 2010
I m trying to create a datagrid on flash cs3 with AS3. I have managed to make the cells multiline and wordwrap. But I couldnt make the headers of the columns multiline and wordwrap.Here is my .as file code:
Code:
package {
import fl.controls.listClasses.CellRenderer;
public function MultiLineCell()[code]......
View 2 Replies
Nov 22, 2005
I need to evalueate a string as code... let me show you an example...Lets say, that I have a string:
Code:
string = "Math.cos(var1)*Math.sin(var2)";
And what I need to do, it to use its contents as code and not string like here:
Code:
var3 = Math.cos(var1)*Math.sin(var2);
View 3 Replies
Jun 23, 2011
I have a json object where I don't know some of the values at compile time, but I do know that all objects will be valid at runtime. So in the example below, the first trace will output "50" and I want the second trace to output "100", the value of someObject.someparam, which gets defined at runtime.
var plan:Object = { "testParam": 50, "testParam2": "someObject.someParam" }
var someObject:Object = {"someParam": 100}// this actually doesn't get defined until runtime
trace ("testParam " + plan.testParam);
trace ("testParam2 " + someSortOfInterpreter(plan.testParam2);
View 2 Replies
Aug 16, 2010
I have an itemrenderer used by multiple datagridcolumns and I need to have some condition in the itemrenderer based on the headertext of the datagrid column. Can I access the headertext property from within the itemrenderer?
My itemrenderer extends the LinkButton control and implements the IDropInListItemRenderer interface.
View 1 Replies
May 20, 2010
I need to get the value of the item clicked and the name of the columns.[code]But this way it returns 'undefined'.But if I put the name already in function, I can get the correct data, example:Alert.show(''+datagridlist.selectedItem.create); // create is a column name in mysql.But this variable must be created dynamically, example:[code]I'm at it on time and I can not convert the string to column name.
View 2 Replies
Feb 16, 2012
The question seems to be simple, however it create problems for me. I have a dataGrid with two dataFields: peerID, name. The information in a grid updated dynamically when new user joined the group (I'm creating a chat). I need that information about user deleted from a grid after it's disconnect. So, on "NetGroup.Neighbor.Disconnect": event i want to compare "event.info.peerID" value with all peerID values in a grid and delete info about disconnected user.
I'm trying to use next construction:
for (var i:uint, len:uint = txtDataArray.length; i < len; i++)
{
if (txtDataArray.source[i] == event.info.peerID)
{
[code]....
But it doesn't work at all!
I'v noticed that construction txtDataArray.source[i] (or txtDataArray.getItemAt(i) ) returned [object GridColumn] insead of value. So, I have two questions:
1) How to get the value of exact cell?
2) How to organized info delete after user disconnect?
View 1 Replies
Jan 26, 2011
I have that function in the class:
private function fireItemCreated(data: ByteArray): void {
setTimeout(function(): void {
var event: ItemCreatedEvent = new ItemCreatedEvent(data);
dispatchEvent(event);
}, 1000);
}
This function called to dispatch item created event when image thumbnail created.But it delays event on some time to prevent user interface freezes. And I'm guessing what could be happen if garbage collector executes after fireItemCreated function call but before timer event. Does the closure will be removed or it stays until it will be executed?
View 1 Replies
Nov 29, 2009
I am trying to implement simple chat application using flex. In it all my chat messages are stored as array collection items, where each item is a string (correspondent to one chat message). I am using datagrid to display all messages. One message goes to one cell of datagrid. Here how it looks: [URL] I want to add a feature for the tool to handle big lines of text. Is there a way to implement line break in case it's very long.
View 2 Replies
May 27, 2004
I have an AdvancedDataGrid where i build the columns dynamically (variable number of columns) in ActionScript, and i want the dataTip to display the column headerText when the user hovers over a cell. Adobe's example dataTipFunction:
private function tipFunc(value:Object):String
{
if (value is AdvancedDataGridColumn)
return "Column Name";
[code]....
But in this case the value is only an AdvancedDataGrid column if the user hovers over a column header? I want the dataTip to always show the headerText for that column. So if i have to use this function, then how do i get the column headerText for a cell? And as i understand the dataTipField i can't really use it to statically equal column.headerText (dataTipField = headerText).
View 1 Replies
Feb 14, 2010
I've added an eventListener to the COLLECTION_CHANGE event that is fired when the grid is finished resorting the items in its dataProvider, after the user clicks on a column header:MyType (myDataGrid.dataProvider).addEventListener(CollectionEvent.COLLECTION_CHANGE,onDataGridResort);
View 1 Replies
Mar 15, 2010
I am working on a problem since a week soon, but I still couldn't make it work as expected. I have a DataGrid which has HBox with a CheckBox an a Label as itemRenderer (see Code below). When I tap in to the Cell the standard itemEditor pops up and lets you enter the content of the label. Thats the standard behavior. I works fine except for 2 problems:
If I enter to much text, the horizontal srollbar pops up, and the cell is filled with that scrollbar. As you see I tried to set the horizontalScrollPolicy to off, but that doesnt work at all... I tried to do that for all the different elements, but the failure is still existent. When I have filled more than one row, there is an other mistake happening. If I tap on a row, the datagrid selects the one below that row. That's only if one line is already selected. If I tap outside the datagrid and then, tap at any row the itemEditor of the right row will show up... Is there anything now wright in the setup of my set data method?
package components
{
import mx.containers.HBox;
import mx.controls.CheckBox;
[Code]......
View 2 Replies
Mar 24, 2010
From this (normal dataGrid)
into this (horisontal data grid)
How to turn Flex MXML DataGrid into something like Horisontal DataGrid? (may be some how with Flash builder 4?)
Keeping all stuff DataGrid has like eating data from data provider sortind dragging - droping items etc
View 1 Replies
Oct 15, 2011
I have two datagrids:
- Division
- Members
Both have single columns. Selecting one item from Divsions datagrid should display members of that Division in the Members datagrid. But following code has some problem and Members of a particular division do not show up when respective Divsion is clicked.
Following are some snippets of the related code. Hope someone can spot an error in it.
[Code]..
View 2 Replies
Jul 31, 2009
For poor performance reasons, the DataGrid will cache checkboxes and reuse them for different rows. If you have 50 rows, it won't create 50 checkboxes. It will create as many checkboxes at are visible, plus a few more for padding, and then reuse them as you scroll. This is why you need to explicitly manage their state. How can improve it ? How can fixed checkbox value ? i used checkbox like below But checkbox doesnot remembering the values
[Code]...
View 3 Replies
Jan 22, 2007
my code is pretty straight forward. i can't get the 'if...then' statement to fire correctly. var t DOES equal "_level0.item" + sel at some point, as seen in my second code snippet, but the for loop doesn't ever see it and only the false code is executed.
Code:
_global.heck = function(sel) //sel will be a number sent from another function
{
[code].....
View 14 Replies
Oct 6, 2010
I want to convert a datagrid back to a string. I tried Code:var myString = _root.myDatagrid.toString();But this does not seem to work.
View 5 Replies
May 17, 2009
I'm trying to do a math exercise, but with images (MCs) instead of variables. For 1+1, I want them to drag into the answer box a MC that corresponds to 2 (a picture with 2 apples on it) I'm OK with most of that, but how do I evaluate the MCs to tell them they got the problem right? or is there
View 12 Replies
Apr 17, 2009
I start an eventListener on frame 73. If I stop my movie and test animations in the flash player (going back to frame 1 for instance), the movie starts throwing errors because the listener is basically trying to listen on an object that doesn't exist anymore. So I was wondering if I could try somekind of "try {stage.removeEventListener(Event.ENTER_FRAME, myfunction}". I tried that with a catch statement but of course "try {}" doesn't work with asynchronous events. How would I go about that?
View 9 Replies
Feb 9, 2011
I have 25 textboxes on stage. I am using a for loop to point to each textbox and evaluate the contents. When I come across a textbox that has the letter "Y" in it I want to place an object called colorbox at a certain location. To do this I have assign the value in each textbox to a variable called tf and then evaluate the variable tf to see if it contains the letter "Y". When I trace this variable outside of my if statement it correctly shows the contents of the current box, however within my if statement it doesn't. Also the colorbox doesn't get placed at the designated coordinates and I get the following error message:[code]
View 1 Replies
Nov 22, 2011
i have a small challenge calculating and evaluating a predefined path
here is my challenge in short.
- i got a path as a single color line on a white background (bitmap object but could as well be a vector shape)
- the path is a closed loop path (like a twisted and bend circle, let's call it a bean shape).
- i then need to move an object along this path in x steps but only once and stop exactly where it started
This means, i need to:
- find a start end point
- calculate the length of the path
- set keynodes along the path with X amount of spacing between (length/x)
- it got to be semi precise (within 1-2 px.)
one idea could be to loop throught the pixels till to find a color pixel and use this as the starting point, then use an vector with a predefined length (ex. 5 px) "rotate" it till it find a new color pixels and mark this as a new node, repeat the process till you get close to the starting point, and by using Trial and error you'll eventually have mapped the path, but this method is clumsy and not very accurate, if you don't hit the starting point spot on the first time, you'll recalculate everything over again.
View 4 Replies
Feb 8, 2011
I have 25 textboxes on stage named sw1 through to sw25. I want to evaluate the contents of each box using a for loop. How can I do this. Note the following code does not work for me.
for(var i = 1; i<26;i++)
{
var t = "sw"+i
trace (t.text)
}
I get this error message when I run my program:
Property text not found on Number and there is no default value. at Mastercalendar_fla::MainTimeline/frame1(E)
View 1 Replies
Jun 29, 2009
I'm very new to Flash, and I'm not a programmer, I have an Input text box named txtNe2 where a user will type an answer to a question. I want to evaluate the answer when the user pushes the Enter key and respond by sending the movie to either the "Ne2C" frame or the "Ne2I" frame (for the response to the correct or incorrect answer).
View 4 Replies
Feb 4, 2010
I am attempting to style the headers in a flex datagrid and I keep getting the warning:
Type DataGrid in CSS selector 'DataGrid' must be qualified with a namespace
What does this mean? I have gone through a bunch of tutorials and none of them have worked. It seems like changing a the colors in a datagrid should be relatively simple.
Here is a code sample:
<mx:Style>
.headerCustomStyle
{
fontWeight: "bold";
[code]....
View 3 Replies
Sep 21, 2011
I have a String variable in my flex (flash builder 4) application containing CSV data. I need to allow the user to download this data to a local file. For example, giving them a "csv" button to click and it might present them with a save file dialog (and I would be sending the contents of my string variable).Is this possible / how ?I am using the ResuableFX component for the datagrid to csv. This the code I ended up with that works to save the string to a text file for the user (in a web browser):
var dg2CSV:DataGrid2CSV = new DataGrid2CSV();
dg2CSV.includeHeader=true;
dg2CSV.target=adgEncounters;
[code]......
View 1 Replies
Apr 13, 2004
I embed a text file into my Flex project and read its contents using code like this:
[Embed(source = "../../data/abc.txt", mimeType = "application/octet-stream")]
private var r_Abc:Class;
var xx:ByteArray = new r_Abc();
[code].....
View 9 Replies
May 13, 2011
in Flex I have something like that: [code]and dg is ALWAYS pointing at DataGrid (even if dg1 has name DataGrid_test and dg2 = DataGrid_test2) and finally action is made on my first DataGrid (DataGrid_test).[code]and search still points at ColorColumn :/ My problem is really easy- I just want to pass to search different dataGrid on each state.But still I don't understand why it doesn't work. My search function uses algorhitm Boyer-Moor for searching through dataGrid.dataProvider for some text. If it find something then it is pushed into new array and after passing whole dataProvider I colorize rows with searched word.
View 2 Replies
Aug 11, 2011
I have a TabNavigator, and each tab is a Module. One of the modules is labelled Units and the full code of the module is posted in this post. There are several problems:
1) Forms are not populated with data from the datagrid selection.
2) Selecting a row and clicking delete gives the very-common error: TypeError: Error #1009: Cannot access a property or method of a null object reference.
A trace on the valueObject unit within the selectionChangeHandler function gives NULL. Why? Note: In other modules (other tabs of the TabNavigator), I have DropDownLists populated with units. This means that the valueObject Unit is defined in the other modules. However, valueObjects should be private to modules, and not shared.
[Code]....
View 1 Replies