ibelar on demo-tutorial
fix cs (compare)
ibelar on demo-tutorial
Update demos/tutorial/actions.p… (compare)
ibelar on demo-tutorial
Update demos/tutorial/actions.p… (compare)
ibelar on Executor-refactor
more behat fix (compare)
ibelar on Executor-refactor
[fix] - Demo Tutorial fix - In… Merge branch 'fix/demo-tutorial… fix behat (compare)
ibelar on demo-tutorial
[fix] - Demo Tutorial fix - In… (compare)
Hi guys, I have a question about custom validation. I have a field that has a parameter required in the model :
$this->addField('field', ['required' => true]);
And when I click save and this field is empty. I get a error message "Must not be null".
But if I want to get another text in this message, how can i do that ?
I tried to do it like this :
$form->onSubmit(function ($f){
if (empty($form->model['field'])) {
return $form->error('field', 'My error message');
}
});
But this does not work because the field has a parameter 'required' => true in the model and shows the default text “Must not be null”.
new \atk4\ui\jsReload(
$ui_element,
[
'selected_items' => $sel->jsChecked()
]
)
$myview = $app->add(['View']);
$grid = $myview->add(['Grid']);
$grid->setModel($model);
$grid_selection = $grid->addSelection();
$bulk_button = $grid->menu->addItem('Bulk Operation');
$modal = $myview->add(['Modal','title'=>'Bulk it baby']);
$modal->set(
function ($m)
{
$form = $m->add(['Form']);
$form->addField('selection_data');
}
);
$bulk_button->on('click',
function ($j, $param) use ($modal)
{
// $param does right here contain the selection values
// how do i get it to my modal, e.g. into the selection_data field
return [
$modal->show()
];
}
,[$grid_selection->jsChecked()]
);
$myview = $app->add(['View']);
$grid = $myview->add(['Grid']);
$grid->setModel($model);
$grid_selection = $grid->addSelection();
$bulk_button = $grid->menu->addItem('Bulk Operation');
$modal = $myview->add(['Modal','title'=>'Bulk it baby']);
$form = $modal->add(['Form']);
$form->addField('selection_data');
$sel = $form->getField('selection_data');
$bulk_button->on('click',
function ($j, $param) use ($modal,$sel,$form)
{
// this form manipulation does not work on a click event
$form->addField('Test',['required'=>true]);
// this return works and $param is set, but is not ideal, sine the modal is now quite static
return [
$sel->jsInput()->val($param),
$modal->show()
];
}
,[$grid_selection->jsChecked()]
);
Hey guys. Can someone point me at the right direction regarding a problem in my model please? I have got a hasOne relation and want to use it with a given condition.
Like having Model1 and Model2, Model1 hasOne Model2 and when I load Model1 I only want to have Model2's loaded that match a given condition (e.g. ownStuff == true)
I tried several methods already and searched around the forums but either it's a dumb question or nobody else has this issue^^ this is the current code:
$this->hasOne('Resource', [ResourceModel::class, 'their_field'=>'id', 'our_field'=>'Resource_id', 'caption' => 'Ressource']]);
$this->ref('Resource')->addCondition('ownResource', true);
btw. it works fine when I add the condition directly into Model2/ResourceModel - but I want it to work from Model1 :(
$this->hasMany('Notification', [
function() {
return (new Notification($this->persistence))->addCondition('model_class', get_class($this));
},
'their_field' => 'model_id']);
Hi everyone, I have issues to get a) the ui ribbon label decorator working in a grid. With the standard hook getHTMLtags HTML looks right but the left part of the ribbon is missing. b) I can't get date format changed to German style 01.03.2020 - the $config['locale']['date'] does not have any effect on my grid. Can't find anything else on the net. Any help?
Hello, did you try $this->app->ui_persistence->datetime_format