Flex :: Compare Data From DataGrid DataField With String Value?

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


Similar Posts:


Xml :: Flex Attribute Datafield Datagrid

Mar 15, 2011

Why cannot I bind xml attribute for datafield? (flex 4)[code]

View 3 Replies

Flex :: Datagrid - Get The DataGridColumn's DataField In Its ItemRenderer?

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

Flex :: Datagrid - Fetch DataField From DataGridColumn?

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

Data Integration :: Compare String With XML

Jul 3, 2006

I have an Array retrived from XML via xPath. I then compare one bucket with a string and dont get the result i want. It seems that the XML string isn't really a string.

[Code]....

View 1 Replies

Compare String In Flex?

Dec 16, 2009

I want to check whether string is empty or not when i create object=Shared.getLocal("abc"); it assigns undefinded to the object at the first time

if(object.data.name=="undefnied") {
// is this correct
}

View 4 Replies

Flex :: String From The Autocad DXF File Does Not Compare?

Nov 22, 2010

the string from the Autocad DXF file does not compare with the string in my AS3 file even though they are absolutely identical.

As a simple example

private function onComplete():void
{
myTextLoader.load(new URLRequest("Drawing1.dxf"));
myTextLoader.addEventListener(Event.COMPLETE, onLoaded);

[Code].....

View 1 Replies

Flex :: Value In Datagrid Itemrenderers Set Data Method Doesn't Return The Correct Data?

Jan 10, 2012

I've got a Gridcolumn in a Datagrid (Spark). The Column's dataprovider is a Number value that gets updated via Binding.Now, without an item renderer the cell displays the correct values.If I set an item renderer, I can't access the values in this renderer.My renderer looks like this, so nothing really do here (for now) but to trace the value, but the value is always NaN.

<?xml version="1.0" encoding="utf-8"?>
<s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%" >[code].......

without the renderer, the column displays the correct values, so apparently the DefaultGridItemRenderer works fine.As requested, here is my Datagrid;

<s:DataGrid id="dataGrid" dataProvider="{_listItems}">
<s:columns>
<s:ArrayList>[code]..........

_listItems is an ArrayList with instances of a model class, which has (amongst others) a property called change of type Number.

View 1 Replies

Flex :: Data Passed From DataGridColumn.itemToLabel To DataGrid.itemRenderer.set(data)?

Dec 4, 2009

I have a DataGrid whose dataProvider is an Array of int Arrays (each with different lengths). Since each row has variable size (and I want to display all the data), I decided to extend DataGridColumn and overwrite the itemToLabel function to be able to display the data. The problem is that I also need to display the data differently depending on the int value.

I believe the only solution is to write an itemRenderer, but the only input the itemRenderer.set(data) function receives is the entire int Array. I believe I need either the exact string returned by itemToLabel or the column index of the cell the itemRenderer is for (to basically do the same parsing I implemented in itemToLabel).

View 1 Replies

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

Flex :: Concate Two Datafield In A Datagridcolumn?

Apr 20, 2011

how to concate two datafield in a datagridcolumn?

View 2 Replies

Data Integration :: Compare Input Text With Imported XML Data?

Oct 5, 2006

Compare input text with imported XML data problem

View 1 Replies

Flex :: Setting DataGridColumn's DataField Based On XML Node With Same Name

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

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

ActionScript 3.0 :: Compare String To A Variable Name?

Sep 9, 2009

Compare a string to a variable name. Is there anyway you can do that?[code]...

View 1 Replies

ActionScript 3.0 :: Compare Between String And A Textfield Value?

Jun 30, 2010

i placed a movieclip with a textfield in it on the stage.i want to compare between the textfield.text value to a string' but always recieve a false value when i'm doing it.when i use trace:

ActionScript Code:
trace ("1:"+returnType(word.myText)+"m");
trace ("2:"+category.catText.text+"m");

[code]........

View 2 Replies

Flex :: Flash Builder - AdvancedDataGrid DataField - Use A Subarray Or Object?

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

Flex :: Transform A String Into Object Name SelectedItem In The DataGrid?

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

Actionscript 3 :: Flash Cannot Compare Radiobutton Label To A String?

Apr 3, 2011

Why first trace prints out not second one whereas I set label in property panel to "hello"?

public function OnClick(event:MouseEvent) {
trace(event.target.label.toString());
if (event.target.label.toString() == "hello") {

[code].....

View 2 Replies

ActionScript 2.0 :: Compare Array's Element (xml Reference) With String?

Jan 22, 2010

I need to compare a number with a element in a Array(curModeDisplay), I can trace the element and see it without problem. But when I try to compare the inside element with a String, it didn't work. Why?

ActionScript Code:
curModeDisplay = new Array();  \this is the Array I need
for (var tvM:XMLNode = tv.firstChild; tvM!=null; tvM=tvM.nextSibling){
curModeDisplay.push(tvM.childNodes); \received element fine here
}
trace(curModeDisplay);  \ This works fine. Array displays correctly

When I need those elements from the Array(curModeDisplay) and try to make some comparison work, it did not work:

ActionScript Code:
function DigitCompare():Void{
for(var index in curModeDisplay){
if(curModeDisplay[index]=="11265"){ //it seems didn't work here

[code]....

Is that because the element in the Array is reference to the XML node, and "11265" is String. If so, how should I fix this problem. The "11265" will be changed to any named String type variable in the future.

View 4 Replies

ActionScript 2.0 :: Compare A Flash String To The Lines In The Textfile?

Oct 26, 2006

I have this textfile with a lot of words in it. One word on each line.

How can I compare a flash string to the lines in the textfile? I want to know if the string matches any of the lines in the file.

View 1 Replies

Actionscript 3 :: Flex: Datagrid - Break Line In Case Of Very Long String

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

ActionScript 3.0 :: Compare User Inputted String To A Variable Already Created?

May 22, 2010

I am trying to compare a user inputted string to a variable already created.  When I do this with int it works fine but when I try changing it to strings I can't get it to work.

[Code].....

View 3 Replies

ActionScript 3.0 :: String Compare Does Not Work Inside Array For Match

Feb 6, 2010

How to compare a string with strings inside an array for a match? I have a file in which each sentence (or word) (generally string) is present in a new line. Opened the file and read the contents to a string.

Code:
private function readHandler(event:Event):void{
_str = _readStream.readUTFBytes(_readStream.bytesAvailable);
_strArray = _str.split(" "); //contains each string that appears in a new line
_length = _strArray.length;
[Code] .....

But this doesn't work. Seems like if(_input == _strArray[i]) never gets executed even if they are equal. What might be the problem. Is there some better way to so it?

View 6 Replies

Flex :: Datagrid - Display A Multi-line Column Header Using The Flex Spark Data Grid?

Apr 13, 2011

How can you display a multi-line column header using the Flex Spark Data Grid for Flex 4.5?

View 5 Replies

Flex :: Datagrid - Flex ByteArray Data Field

Mar 25, 2010

The data provider (ArrayCollection) for my data grid consists of objects with ByteArray (int) fields. How do I make the data field display as int without transforming my data provider?

View 1 Replies

Flex :: DataGrid Not Displaying Data

Mar 31, 2010

I have a custom dataGrid that acts more like a 2D list (if that makes sense at all). I am dynamically creating the columns and recreating the dataProvider to suit my needs. While debugging I can see that I am creating the columns and setting them to the dataGrid and creating and setting the dataProvider, but for some reason I am able to see the dataGrid and the columns but not the data.

[Bindable]
private var mockData:ArrayCollection = new ArrayCollection([
{value: "425341*"},
{value: "425341*"},

[Code]....

View 2 Replies

Flex :: How To Link Data To A Datagrid

Jun 9, 2010

I'm following flex tutorials but i'm not doing exactly as they do, so :hat i want I have an input text, with a button 'search'.I want when this button is clicked that the data returned by the function search are displayed in the datagridWhat i have :

The text input :
<s:TextInput includeIn="DetailServeurs" x="58" y="361" width="209" id="txt_search" text="Default text" focusIn="txt_search_focusInHandler(event)"/>

[code]........

View 1 Replies

Flex - Refresh Datagrid With Hierarchical Data?

Dec 3, 2009

how can I refresh the displayed data in a Datagrid when the underlying ArrayCollection changes?

<nmoschitz:dataProvider>
<mx:HierarchicalData source="{arrCol_groupedData}"
childrenField="accounts"/>
</nmoschitz:dataProvider>

Calling a simple refresh (like with a simple arraycollection as a dataprovider, or with a refresh on the Grouping Collection) does not work. Also re-assigning the arrayCollection to the Hierarchical Data and then assigning this one again to the Datagrid does not work (even with calling invalidateProperties() or validateNow()).

View 2 Replies

Flex :: DataGrid Edits Label Instead Of Data

Jan 20, 2010

I have an editable DataGrid in Flex, with data full of numbers. The columns have no special itemRenderer, but a labelFunction, which returns the number as-is if positive, but puts it in parentheses if it is negative, like so

27.3 => "27.3"
-27.3 => "(27.3)"

Now, these cells are editable. When I try to edit a cell with a positive number, nothing is wrong. But if I try to edit a negative number, it starts editing (27.3) instead of editing -27.3. Because of this, when the edit is done, the labelFunction is evaluated with the new value in parentheses(i.e.,labelFunction is called with "(30.5)"), and converting it to a Number results in NaN. So, I want to know if I can make the DataGrid edit the data in the dataProvider instead of the label that it shows.

View 1 Replies







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