<commit_before><?php

require 'init.php';
require 'database.php';

$g = $app->add(['Grid']);
$g->setModel(new Country($db));

//Adding Quicksearch on Name field using auto query.
$g->addQuickSearch(['name'], true);

$g->menu->addItem(['Add Country', 'icon' => 'add square'], new \atk4\ui\jsExpression('alert(123)'));
$g->menu->addItem(['Re-Import', 'icon' => 'power'], new \atk4\ui\jsReload($g));
$g->menu->addItem(['Delete All', 'icon' => 'trash', 'red active']);

$g->addColumn(null, ['Template', 'hello<b>world</b>']);
//$g->addColumn('name', ['TableColumn/Link', 'page2']);
$g->addColumn(null, 'Delete');

$g->addAction('Say HI', function ($j, $id) use ($g) {
    return 'Loaded "'.$g->model->load($id)['name'].'" from ID='.$id;
});

$g->addModalAction(['icon'=>'external'], 'Modal Test', function ($p, $id) {
    $p->add(['Message', 'Clicked on ID='.$id]);
});

$sel = $g->addSelection();
$g->menu->addItem('show selection')->on('click', new \atk4\ui\jsExpression(
    'alert("Selected: "+[])', [$sel->jsChecked()]
));

//Setting ipp with an array will add an ItemPerPageSelector to paginator.
$g->setIpp([10, 25, 50, 100]);<commit_msg>forgot the demo<commit_after><?php

require 'init.php';
require 'database.php';

$g = $app->add(['Grid']);
$m = new Country($db);
$m->addAction('test', function() { return 'test was successful!'; });
$g->setModel($m);

//Adding Quicksearch on Name field using auto query.
$g->addQuickSearch(['name'], true);

$g->menu->addItem(['Add Country', 'icon' => 'add square'], new \atk4\ui\jsExpression('alert(123)'));
$g->menu->addItem(['Re-Import', 'icon' => 'power'], new \atk4\ui\jsReload($g));
$g->menu->addItem(['Delete All', 'icon' => 'trash', 'red active']);

$g->addColumn(null, ['Template', 'hello<b>world</b>']);
//$g->addColumn('name', ['TableColumn/Link', 'page2']);
$g->addColumn(null, 'Delete');

$g->addAction('test');

$g->addAction('Say HI', function ($j, $id) use ($g) {
    return 'Loaded "'.$g->model->load($id)['name'].'" from ID='.$id;
});

$g->addModalAction(['icon'=>'external'], 'Modal Test', function ($p, $id) {
    $p->add(['Message', 'Clicked on ID='.$id]);
});


$sel = $g->addSelection();
$g->menu->addItem('show selection')->on('click', new \atk4\ui\jsExpression(
    'alert("Selected: "+[])', [$sel->jsChecked()]
));

//Setting ipp with an array will add an ItemPerPageSelector to paginator.
$g->setIpp([10, 25, 50, 100]);
{'fraction_non_alphanumeric': 0.27931323283082077, 'fraction_numerical': 0.01340033500837521, 'mean_word_length': 5.654596100278551, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3045281', 'n_tokens_mistral': 889, 'n_tokens_neox': 867, 'n_words': 190}