omusico / zfdatagrid

Automatically exported from code.google.com/p/zfdatagrid
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

can i in (crud.before_insert) callback - set form field value so that it reflect the changes in table after insert #821

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.$feeupdategrid->listenEvent('crud.before_insert',array($this,'feeUpdateCallbac
k'));

public function feeUpdateCallback(Bvb_Grid_Event $event){
$params = $event->getParams();
$subject= $event->getSubject();

$previousDues = $params['values']['previousDues'];
$tuitionfee = $params['values']['tuitionfee'];
$grandTotal = $params['values']['grandTotal'];

$updatedAmount =intval($previousDues)+intval($tuitionfee); -working till here

//$subject->getForm(1)->getElement('grandTotal')->setValue($updatedAmount);  -- 
not working

//$dateFieldName = $subject->getParam('grandTotal'); -- not working
//$subject->setParam('grandTotal',$updatedAmount); -- not working
}

2.i am able to access the form field using $params['values']['--']
  but unable to set the values .

3. because i want to change value of another field before saving it into the 
table .

Is it possible or i might be doing something wrong .
new to zend and zfdatagrid . any advice is good .thanks

Please insert the appropriate values;
                    Zend Framework version: VERSION = '1.11.9'
ZFDatgrid Version (Bvb_Grid::getVersion()): VERSION = '$Rev: 1868 $';
                          Operating system:windows 7
                               PHP Version:5.3
               Database Server and version:mysql
Source Adatapter:

Please provide any additional information below.

Original issue reported on code.google.com by aj.jaini...@gmail.com on 8 Feb 2012 at 8:06

GoogleCodeExporter commented 9 years ago
Hi,

I didn't confirm, but try this:

$event->setParam('grandTotal',$updatedAmount);

IM

Original comment by ivomonte...@gmail.com on 9 Feb 2012 at 9:24

GoogleCodeExporter commented 9 years ago

Original comment by ivomonte...@gmail.com on 14 Mar 2012 at 8:20