Flex :: Settingflex Datafield With A Function?
Feb 6, 2010
I can't seem to get this right and everything I read is kind of like my problem but not quite. This seems like it would be pretty easy. All I want to do is set the value of a datafield using a function. I call in an xml file and can set the value of a datafield from that xml (in this case it's a category id as a number). But then I want to translate that number into a name by correlating it with a different data array.
so basically i just need to pass the catId into a function in the datafield but can't get it to work.
<mx:DataGridColumn color="0x00101F" textAlign="center" editable="true" id="categoryField" headerText="CATEGORY" dataField="getCategoryName(@catId)" editorDataField="text"></mx:DataGridColumn>
[Code]....
View 1 Replies
Similar Posts:
Mar 15, 2011
Why cannot I bind xml attribute for datafield? (flex 4)[code]
View 3 Replies
Apr 20, 2011
how to concate two datafield in a datagridcolumn?
View 2 Replies
Aug 20, 2010
I'm trying to reach the dataField of a DataGridColumn in the itemRenderer. Below is the dataGrid:
<mx:Script>
<![CDATA[
[Bindable] public var weeksOfMoth:ArrayCollection = new ArrayCollection([
[code].....
In the set data function of the itemRenderer, I receive an entire week (which is ok), but the itemRenderer doesn't know which day to use because the dataField is unknown. Does anyone know how to reach this dataField in the itemRenderer?
View 5 Replies
Jan 10, 2012
I have the following datagrid:
<mx:DataGrid id="question" x="9" y="289" width="100%" height="54" visible="{false}" >
<mx:columns>
<mx:DataGridColumn dataField="ans1" headerText="ans1"/>[code]..........
I need to access the data pointed by the dataField, and bind it to a label, but i don't known how to get it.
<s:Label id="debug" x="575" y="106" width="56" height="35" text="{data_from_coloumn_grid_ans1}" />
View 1 Replies
May 24, 2010
[code]I am trying to define a DataGrid such that the row nodes will represent new rows in the DataGrid and the column nodes will be used to auto-populate the DataGrid's columns. I am having a problem setting the dataField for each of the DataGridColumn ojects created.The DataGrid is created but the cell values for row 1 are all 0.51 and row 2 are 0.61.
View 1 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
Aug 5, 2011
I have an advanced data grid in flex (flash builder 4). It's dataProvider is pointing to an ArrayCollection (this._encounters). Inside that array collection is a property that is an object (a client object).
I tried setting the dataField to "clientObj.firstName" to refer to the first name property within the clientObj property of the this._encounters array collection. It did not show anything. So, I added a labelFunction to that column (code below) to set the text in the cell. This works fine and now I have values showing in the grid.
The problem is now when I click the title of column to sort it. It throws an error that property clientObj.firstName is not found in my array collection!So, is there a better way to set the dataField / source for a column and point at a property in a sub-object -- or a way to fix the sort?
Below the first column
<mx:AdvancedDataGrid x="0" y="25" id="adgEncounters" designViewDataType="flat" width="100%" height="100%" dataProvider="{this._encounters}">
<mx:columns>
<mx:AdvancedDataGridColumn headerText="first" dataField="clientObj.firstName"
[code]....
In the mxml above, this is the changed line - notice the stringSortByField added:
<mx:AdvancedDataGridColumn headerText="first" dataField="clientObj.firstName" sortCompareFunction="{stringSortByField('clientObj','firstName')}" labelFunction="encounterGridLabelFunct"/>
If it were a numeric field use the numericSortByField. If it were a date string from a database, use the dateSortByField function instead.
View 1 Replies
May 22, 2009
Let's say I have a Custom Event Class, and it has several Event types stored in static Constant:
[Code]...
Is there an easy way to validate that the type passed to the Constructor is one of the Static Constants of the Class, without having to check it against each value?
View 5 Replies
Jan 10, 2012
I have an AS3 program that calls a function multiple times. The function must return multiple variables, so I created a class for the function to declare an object containing all of these variables. For example, here's my class:
package
{
public class PER
{
[Code].....
Let's say the calling program calls the function, which returns the variables into data_set1 (where data_set1 depends on input variables arg1, arg2, arg3) using:
var data_set1:PER = function_name(arg1, arg2, arg3);
The calling program does some stuff, then calls the function again, but returns the variables into a new variable name, data_set2:
var data_set2:PER = function_name(arg4, arg5, arg6);
My intention is that data_set1 and data_set2 are different (e.g. not linked together).
My question is, given that arrays are passed by reference, will data_set1 be modified to agree with data_set2 upon the 2nd function call? Why or why not?
View 1 Replies
Aug 4, 2009
Given a Function object, can you get its name as a String? See example:
function doThingWithCallback(callback:Function):void {
trace("i'm going to run " + callback); // outputs "i'm going to run function Function() { }"
}
[code]....
This example is sort of arbitrary, but it would be very useful to get function names for debugging, particularly when passing around Function objects.
View 1 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
Mar 14, 2011
I have a small question. I am probably misunderstanding something, but when I do :
[Code]....
View 1 Replies
Sep 1, 2010
I want to call an App function inside a (I know about the Component scope already).What I mean is this:
<mx:Script>
<![CDATA[
public someFunction():void {
[code]......
View 1 Replies
Nov 1, 2010
I've got a Vector of ViewToActionMap objects, which have following constructor:
public function ViewToActionMap(_forModule:eModule,
_forAction:eViewAction,
_toFunction:Function,
[code].....
View 1 Replies
Aug 11, 2011
OK, from what I know actionscript in Flex runs asynchronously. I need the ability to run a method in a loop synchronously. Consider this code:
public class CustomerContainer extends VBox
{
public function CustomerContainer ()
{
[Code]....
This is not my exact situation as it is a bit more complicated to explain here. There is an abstract class and several custom view objects derived from it. Some of the views are dependent on others being completed first but I cannot seem to order them in the correct order. TIMERS are not an option. Probably not explaining this correctly.
View 2 Replies
Oct 8, 2009
I've been banging my head against the wall with this one. I have the following set function in Flex. [code]If I set the periodChangeAmount to -1 or 1 the set method gets fired. If I set it to zero it doesn't get fired. What's the deal? Does anyone know why it wouldn't get called when setting it to zero. If I change the object type to a number or even an object it still doesn't work as expected.
View 2 Replies
Dec 22, 2009
I want to export some of my functions to external so that other people can embed my SWF into their's and invoke the function, how can I achieve that?
View 1 Replies
Mar 24, 2011
I am trying to add a button to a group in a Flex 4 application from within a function like this[code]...
View 1 Replies
Apr 16, 2011
I want to call a function only when the air application is run on a system for the first time after installation. Is there something I can check to determine this?
View 1 Replies
Feb 29, 2012
I want to replace the tags "<" with < and ">" with "'>" in following xml:
<HISKPI>
<HISKPIValues StrategyID="0" PrimaryKPI="103" MonetaryBenefit="Yes"/>
<HISKPIValues StrategyID="0" PrimaryKPI="104" MonetaryBenefit="Yes"/>
<HISKPIValues StrategyID="0" PrimaryKPI="105" MonetaryBenefit="Yes"/>
</HISKPI>
How it can be possible.
View 1 Replies
Jul 27, 2009
package asas
{
public class main extends EventDispatcher[code].....
I have this class and a MXML file... how will i call the function doCheck in button. When i call like this, it throws me an error.
<mx:Button
styleName="LoginButton"
id="loginButton" [code]...
View 2 Replies
Sep 4, 2009
I have a component that I hand over a function
public var func : Function;
Now the function is a function that has parameters in its signature
public function myFunction(s : String) : void {
doSomething(s);
}
from my component I can call the function with
func.call();
how to invoke the function with its parameters?
View 1 Replies
Sep 21, 2009
I want to make a Flash or Flex front end for my R code, I want to call an R function from a website (using Flash) what is the best way to go about connecting Flash and R?
View 2 Replies
Nov 11, 2009
How can I pass a 'set' function as the Function Object argument of another function?eg:
public class IdModel
{
private var _id:String;
[code].....
View 1 Replies
Dec 21, 2009
Say I have four sub-classes of 'Car'. One for each color. I want to have one function that can build and return a 'color-car' sub-class based on the passed value. This is a dumb example, I know, but it is precisely what I am trying to do only on a smaller scale.
public class Car
{
}
public class BlueCar extends Car
[code]....
Ok. You get it. This doesn't work for a reason unknown to me. I get 1118 errors which complain about conversion of BlueCar into Car, etc...
View 4 Replies
Feb 1, 2010
I'm a complete Flex/Flash noob, running Adobe Flash Builder 4 Beta 2. I have a main component that needs to be able to call several popups, each mostly the same except for one function and a few labels. Obviously, I'd prefer to be able to define this function and change those labels when calling the popup instead of having tons of .mxml files with nearly the same code, I just don't know how to do it. I figured out how I can change the labels, but not sure how to redefine the function.For simplicity's sake, let's say my code looks like this:
main.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" :s="library://ns.adobe.com/flex/spark"
[code].....
View 2 Replies
Feb 20, 2010
I'm just wonder if its possible to change States via a function in flex?
View 1 Replies
Mar 3, 2010
I've got a flex project that I'm working on. Currently I've got a popup that consists of another mxml file containing a form.
Once the form is filled in and submitted I'd like to run another function then the popup closes on the main mxml file, but I'm not sure how to go about doing this?
Here's my popup code
private var weightadd:weight_add; //POP UP ADD WEIGHT FORM
private function weightAdd():void {
weightadd = new weight_add();
[Code]....
Currently in my weight_add.mxml file I'm using a button to close the popup, I'd like have this button close the popup and then call a function in my main.mxml file - I'm just wondering how I go about doing this.
<mx:Button x="186" y="83" label="Cancel" styleName="formbutton" id="cancel_button" click="PopUpManager.removePopUp(this);"/>
View 1 Replies
Jun 6, 2010
I have a set of data (in ArrayCollection) and I need to fit a power function { f(x)= B + x^alpha } to it, before display in LineChart. As result I need the alpha and B paremeter.
View 1 Replies