| Id | Surname | Name | Sex | Sons | Daughters | Born | + |
|---|---|---|---|---|---|---|---|
| 113 | Male | 0 | 0 | 1970/01/01 | |||
| 112 | Mrdati | Krtky | Male | 3 | 323 | 1970/01/01 | |
| 111 | fdsfs | Martin Vocásek | Female | 2 | 0 | 1970/01/01 | |
| 110 | xcycyxfrgdf | 12313 | Male | 123123 | 123123 | 1970/01/01 | |
| 109 | sdf | sdf | Male | 0 | 0 | 1970/01/01 | |
| 108 | 1 | xxxx | Male | 0 | 0 | 1970/01/01 | |
| 107 | Sefcik | jjhg | Female | 0 | 0 | 1970/01/01 | |
| 106 | asdff | jok | Male | 0 | 0 | 1901/12/13 | |
| 105 | nazdar | Female | 0 | 0 | 1970/01/01 | ||
| 104 | 1 | fodfsgfd | Female | 0 | 2 | 1970/01/01 | |
| 103 | ccool | Male | 0 | 0 | 1970/01/01 | ||
| 102 | dsfgdfg | root | Male | 0 | 0 | 1970/01/01 | |
| 101 | hustý | Michal | Male | 0 | 0 | 1970/01/01 | |
| 100 | fff | Female | 0 | 0 | 1970/01/01 | ||
| 99 | Zkouškaassadasd | Zkouškadfsdf | Female | 0 | 0 | 2012/03/11 |
protected function createComponentEditableTabella($name) {
$model = $this->context->model; // in PHP 5.4 won't be necessary
$grid = new Tabella(array(
'context' => $this->context,
'source' => $this->context->model->users->source(),
'limit' => 15,
'sorting' => 'desc',
'onSubmit' => function($post) use ($model) {
$post['born'] = strtotime($post['born']);
$model->users->save($post);
},
'onDelete' => function($id) use ($model) {
//$model->users->delete($id);
}
));
$grid->addColumn('Id', 'id', array(
'width' => 30
));
$grid->addColumn('Surname', 'surname', array(
'width' => 100,
'editable' => true
));
$grid->addColumn('Name', 'name', array(
'width' => 100,
'editable' => true
));
$grid->addColumn('Sex', 'sex', array(
'type' => Tabella::SELECT,
'options' => array('male' => 'Male', 'female' => 'Female'),
'width' => 50,
'editable' => true,
));
$grid->addColumn('Sons', 'sons', array(
'width' => 65,
'editable' => true
));
$grid->addColumn('Daughters', 'daughters', array(
'width' => 65,
'editable' => true
));
$grid->addColumn('Born', 'born', array(
'type' => Tabella::DATE,
'dateFormat' => '%Y/%m/%d',
'editable' => true
));
$grid->addColumn('+', Tabella::ADD, array(
'type' => Tabella::DELETE
));
$this->addComponent($grid, $name);
}
(c) 2011 Vojtěch Knyttl, New BSD Licence. Tlumočení francouzštiny. Kulturní přehled.