Get selected row to variable


#1

how get row selected grid?
return to variable: 0,0,0,0 for 4 selected record.

require './database.php';
$m = new Crud1($db1);
$g = $tab->add("CRUD");
$g->setModel($m);
$g->addQuickSearch(['col3', 'col1'], true);
$sel = $g->addSelection();

$b2=$g->menu->addItem('row selected');
$b2->on('click', function($j, $arg1) use ($sel) {
    return 'slected '.$arg1;
}, ['confirm'=>'sure?', 'args'=>[new \atk4\ui\jsExpression('[]', [$sel->jsChecked()])]]);

#2

Please edit your post so it contains a question or a problem.


#3

it code ok. there was a problem on id NOT incremental.