Radio button in grid


#1

Good afternoon,

I have a grid in which each row has a radio button. I want to get the id value of the selected row. I found a similar example http://stackoverflow.com/questions/7417344/not-in-the-same-line-radiobutton-values. I tried to do similar to what was done in the first case, however, I continue to receive the value 0 for id.
My code:

$form = $this->add('Form');
$grid1 = $form-> add('Grid');
$this->js('reload_grid',$grid1 -> js() -> reload());
	
$tab1 -> add($grid1) -> setModel('Model_Objekat',
    array('tip','kategorija','korisnik','mesto','investitor','naziv','adresa','biro','datum'));
$grid1 -> addColumn('template','izbor') 
-> setTemplate(
    '<input type="radio" id = "izbor" name="izbor" value="<?$id?>"/>');
$grid1 -> addOrder() -> move('izbor','first') -> now();		
$form -> addSubmit('Nastavi');
	
if ($form -> isSubmitted()) {
$obj_id = (int) $_POST['izbor'];
$this->js()->univ()->successMessage('Objekat id: <b>'.$obj_id.'</b>')->execute();
}

Thank you in advance


#2

Use {$id} instead of <?$id?> which is a new template format for 4.3.