[flexcoders] how to get value from datagrid cell?

2005-05-24 Thread Doodi, Hari - BLS CTR
Hi All,
One small and very simple question I can not figure it out how - How
to get the value from a cell of datagrid?
I am tried the following but in vain. Please some one help me out. Thanks in
advance.

Function setData(event:Object)
{
myDataGrid.getColumnAt(event.columnIndex).text  
AND 
myDataGrid.getColumnAt(event.columnIndex).value
}

Thanks!
Hari



 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] how to get value from datagrid cell?

2005-05-24 Thread jeff tapper
You need to tell it which row of data you want

myDataGrid.getItemAt(rowNum).column Name

At 10:07 AM 5/24/2005, you wrote:
Hi All,
   One small and very simple question I can not figure it out how - How
to get the value from a cell of datagrid?
I am tried the following but in vain. Please some one help me out. Thanks in
advance.

Function setData(event:Object)
{
   myDataGrid.getColumnAt(event.columnIndex).text
   AND
   myDataGrid.getColumnAt(event.columnIndex).value
}

Thanks!
Hari



--
Yahoo! Groups Links
* To visit your group on the web, go to:
* 
 http://groups.yahoo.com/group/flexcoders/http://groups.yahoo.com/group/flexcoders/
  

*
* To unsubscribe from this group, send an email to:
* 
 mailto:[EMAIL PROTECTED][EMAIL PROTECTED] 

*
* Your use of Yahoo! Groups is subject to the 
 http://docs.yahoo.com/info/terms/Yahoo! Terms of Service.



 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] how to get value from datagrid cell?

2005-05-24 Thread Doodi, Hari - BLS CTR
Jeff,
Thanks for response, you mean 

Var dataValue =
myDataGrid.getItemAt(event.itemIndex).getColumnAt(event.columnIndex).columnN
ame;

I don't want the name of the column user is modifying but I want the value
entered by the user. I am sorry if I confused you. If you have an example
code can you post it?
Here is what I am doing...

mx:DataGrid id=myDataGrid width=100% dataProvider={schedAdj_do}
textAlign=left height=250 headerHeight=50 editable=true
cellEdit=setData(event)

/mx:DataGrid

function setData(event:Object)
{

mx.controls.Alert.show(column Name :
+myDataGrid.getColumnAt(event.columnIndex).columnName);
mx.controls.Alert.show(event.oldValue : +event.oldValue+
new value : +myDataGrid.getColumnAt(event.columnIndex).value);
//myDataGrid.editField( event.columnIndex, colName: String,
data);
}

I was able to alert the old value but not the new value entered by the user.

Thanks!
Hari

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jeff tapper
Sent: Tuesday, May 24, 2005 10:16 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] how to get value from datagrid cell?

You need to tell it which row of data you want

myDataGrid.getItemAt(rowNum).column Name

At 10:07 AM 5/24/2005, you wrote:
Hi All,
   One small and very simple question I can not figure it out how - How
to get the value from a cell of datagrid?
I am tried the following but in vain. Please some one help me out. Thanks
in
advance.

Function setData(event:Object)
{
   myDataGrid.getColumnAt(event.columnIndex).text
   AND
   myDataGrid.getColumnAt(event.columnIndex).value
}

Thanks!
Hari



--
Yahoo! Groups Links
* To visit your group on the web, go to:
* 

http://groups.yahoo.com/group/flexcoders/http://groups.yahoo.com/group/fle
xcoders/ 

*
* To unsubscribe from this group, send an email to:
* 

mailto:[EMAIL PROTECTED]flexcoder
[EMAIL PROTECTED] 

*
* Your use of Yahoo! Groups is subject to the 
 http://docs.yahoo.com/info/terms/Yahoo! Terms of Service.



 
Yahoo! Groups Links



 



 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] how to get value from datagrid cell?

2005-05-24 Thread jeff tapper
ok, try this:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; 
creationComplete=initApp()
mx:Script
![CDATA[
var schedAdj_do:Array;
function initApp(){
 var item1:Object = new Object();
 item1.name = Jeff;
 item1.company=Tapper.net;
 var item2:Object = new Object();
 item2.name = Lisa;
 item2.company=LKJ Hosting;
 schedAdj_do=new Array(item1,item2);

}
function setData(event:Object){
 var col:String= 
event.target.getColumnAt(event.columnIndex).columnName;
 var row:Number = event.itemIndex;
  mx.controls.Alert.show(event.oldValue : 
+event.oldValue+newline+new value : +event.target.getItemAt(row)[col]);
}
]]
/mx:Script
mx:DataGrid id=myDataGrid width=100% dataProvider={schedAdj_do} 
textAlign=left height=250 headerHeight=50 editable=true 
cellEdit=setData(event)/

/mx:Application

At 10:32 AM 5/24/2005, you wrote:
mx:DataGrid id=myDataGrid width=100% dataProvider={schedAdj_do}
textAlign=left height=250 headerHeight=50 editable=true
cellEdit=setData(event)

/mx:DataGrid

function setData(event:Object)
   {

 mx.controls.Alert.show(column Name :
+myDataGrid.getColumnAt(event.columnIndex).columnName);
 mx.controls.Alert.show(event.oldValue : +event.oldValue+
new value : +myDataGrid.getColumnAt(event.columnIndex).value);
 //myDataGrid.editField( event.columnIndex, colName: String,
data);
   }



 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] how to get value from datagrid cell?

2005-05-24 Thread Doodi, Hari - BLS CTR
Hi Jeff,

Thank you very much for the help and the code. That helped me a lot in
understanding getColumnAt() and getItemAt(). Thanks agin.

Thanks!
Hari

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jeff tapper
Sent: Tuesday, May 24, 2005 11:55 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] how to get value from datagrid cell?

ok, try this:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml; 
creationComplete=initApp()
mx:Script
![CDATA[
var schedAdj_do:Array;
function initApp(){
 var item1:Object = new Object();
 item1.name = Jeff;
 item1.company=Tapper.net;
 var item2:Object = new Object();
 item2.name = Lisa;
 item2.company=LKJ Hosting;
 schedAdj_do=new Array(item1,item2);

}
function setData(event:Object){
 var col:String= 
event.target.getColumnAt(event.columnIndex).columnName;
 var row:Number = event.itemIndex;
  mx.controls.Alert.show(event.oldValue : 
+event.oldValue+newline+new value : +event.target.getItemAt(row)[col]);
}
]]
/mx:Script
mx:DataGrid id=myDataGrid width=100% dataProvider={schedAdj_do} 
textAlign=left height=250 headerHeight=50 editable=true 
cellEdit=setData(event)/

/mx:Application

At 10:32 AM 5/24/2005, you wrote:
mx:DataGrid id=myDataGrid width=100% dataProvider={schedAdj_do}
textAlign=left height=250 headerHeight=50 editable=true
cellEdit=setData(event)

/mx:DataGrid

function setData(event:Object)
   {

 mx.controls.Alert.show(column Name :
+myDataGrid.getColumnAt(event.columnIndex).columnName);
 mx.controls.Alert.show(event.oldValue : +event.oldValue+
new value : +myDataGrid.getColumnAt(event.columnIndex).value);
 //myDataGrid.editField( event.columnIndex, colName: String,
data);
   }



 
Yahoo! Groups Links



 



 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/