[flexcoders] Re: How to return data to a database back end and reference updates

2008-05-11 Thread securenetfreedom
timgerr,

dg is the id of the datagrid.

Jeff


--- In flexcoders@yahoogroups.com, timgerr [EMAIL PROTECTED] 
wrote:

 Jeff, I am getting an error :
 var value:String = dg.dataProvider[e.rowIndex][field];
 Access to undefined property dg.
 Not sure what to do, thanks
 
 timgerr
 
  mx:DataGrid id=dg change=onChange(event)/ 
  
  private function onChange(e:DataGridEvent){ 

   var field:String = e.dataField;
   var value:String = dg.dataProvider[e.rowIndex][field];
   sendDataToPHP(field, value);
  }
  
  -Jeff
  
  
  
  --- In flexcoders@yahoogroups.com, timgerr tim.gallagher@ 
wrote:
  
   Hello all,
   I have a question on how to return data to a database back 
end.  Here
   is my problem.  I have a PHP and MySQL backend that I 
communicate to
   with a JSon request.  So I have a populated datagrid and want 
to make
   a change (editable = true) and send that data back via a 
HTTPService
   post.  So I post the data to my php page that is waiting the
   information but the problem is, I only have data, to referencing
   information.  When I make a change in my database I will do an 
update
   but I have to reference something (update table set tochange 
= 'data'
   where reference = 'something ';)  How do people update 
databases with
   changes in datagrids?
   
   Thanks for the help,
   
   timgerr
  
 





[flexcoders] Re: How to return data to a database back end and reference updates

2008-05-10 Thread securenetfreedom
timgerr,

Capture the field name and value pass it to the PHP page. 

mx:DataGrid id=dg change=onChange(event)/ 

private function onChange(e:DataGridEvent){ 
 var field:String = e.dataField;
 var value:String = dg.dataProvider[e.rowIndex][field];
 sendDataToPHP(field, value);
}

-Jeff



--- In flexcoders@yahoogroups.com, timgerr [EMAIL PROTECTED] wrote:

 Hello all,
 I have a question on how to return data to a database back end.  Here
 is my problem.  I have a PHP and MySQL backend that I communicate to
 with a JSon request.  So I have a populated datagrid and want to make
 a change (editable = true) and send that data back via a HTTPService
 post.  So I post the data to my php page that is waiting the
 information but the problem is, I only have data, to referencing
 information.  When I make a change in my database I will do an update
 but I have to reference something (update table set tochange = 'data'
 where reference = 'something ';)  How do people update databases with
 changes in datagrids?
 
 Thanks for the help,
 
 timgerr





[flexcoders] Re: How to return data to a database back end and reference updates

2008-05-10 Thread timgerr
Jeff, I am getting an error :
var value:String = dg.dataProvider[e.rowIndex][field];
Access to undefined property dg.
Not sure what to do, thanks

timgerr

 mx:DataGrid id=dg change=onChange(event)/   
 
 private function onChange(e:DataGridEvent){   
  var field:String = e.dataField;
  var value:String = dg.dataProvider[e.rowIndex][field];
  sendDataToPHP(field, value);
 }
 
 -Jeff
 
 
 
 --- In flexcoders@yahoogroups.com, timgerr tim.gallagher@ wrote:
 
  Hello all,
  I have a question on how to return data to a database back end.  Here
  is my problem.  I have a PHP and MySQL backend that I communicate to
  with a JSon request.  So I have a populated datagrid and want to make
  a change (editable = true) and send that data back via a HTTPService
  post.  So I post the data to my php page that is waiting the
  information but the problem is, I only have data, to referencing
  information.  When I make a change in my database I will do an update
  but I have to reference something (update table set tochange = 'data'
  where reference = 'something ';)  How do people update databases with
  changes in datagrids?
  
  Thanks for the help,
  
  timgerr