Interacting
Opening dialog on button click
This is an obvious implementation if you are familiar with JavaScript use in Agile Toolkit, however just to show this often-used approach:
$g=$p->add('Grid');
$g->setSource('user');
$g->addColumn('name');
$g->addColumn('surname');
$g->addColumn('button','info','More Info');
$g->dq->where('name is not null')->limit(5);
if($_GET['info']){
$g->js()->univ()->dialogURL('More info',
$this->api->getDestinationURL(
null,array(
'more_info'=>$_GET['info'],
'cut_object'=>'myform'
)))
->execute();
}
if($_GET['more_info']){
$f=$this->add('Form','myform');
$f->addField('readonly','name');
$f->addField('readonly','surname');
$f->setSource('user');
$f->setConditionFromGET('id','more_info');
}
/?>