-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
features/MultiLine Form Field #700
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #700 +/- ##
==============================================
- Coverage 72.55% 43.34% -29.22%
- Complexity 1933 2047 +114
==============================================
Files 105 106 +1
Lines 4559 4960 +401
==============================================
- Hits 3308 2150 -1158
- Misses 1251 2810 +1559
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## develop #700 +/- ##
=============================================
- Coverage 72.55% 68.82% -3.74%
- Complexity 1933 2043 +110
=============================================
Files 105 106 +1
Lines 4559 4811 +252
=============================================
+ Hits 3308 3311 +3
- Misses 1251 1500 +249
Continue to review full report at Codecov.
|
I'd like $rows to be a model linked with array persistence. Also - user should be able to change that with effect on the UI. @ibelar are you sending ALL the rows back to the frontend or just changed ones ? EDIT: let's leave that for the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very valuable. I do want to change many things, but that can be done at a later time.
if (!$field->read_only) { | ||
$m[$fieldName] = $this->app->ui_persistence->typecastLoadField($field, $value); | ||
} | ||
} catch (\atk4\core\Exception $e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should only catch and display validation errors (they have a dedicated class).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was not sure how to check for post load validation error. Thought that typecastLoadField was supposed to do so. Let me know how this should work and I can change it.
src/FormField/MultiLine.php
Outdated
*/ | ||
private function renderCallback() | ||
{ | ||
$action = isset($_POST['action']) ? $_POST['action'] : null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be using callback's trigger value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The callback url is render only once for the component but the same callback url is used for two different action.
private function getValueForExpression($exprField, $fieldName, $model) | ||
{ | ||
switch ($exprField->type) { | ||
case 'money': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, FOR NOW, but would have to refactor.
$expr = $exprField->expr; | ||
$matches = []; | ||
|
||
preg_match_all('/\[[a-z0-9_]*\]|{[a-z0-9_]*}/i', $expr, $matches); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather should rely on Model's callbacks.. OK for now. Or rather Persistence should do this.
add options property for multiline table look change field test for saving field value. now use isEditable()
- Add width setting using multiline key in ui for addField - update comments
can't merge, CI fails. |
@romaninsh - ci should passed now. Rename onChange method to onLineChange... |
Thanks! |
MultiLine field
New form input in order to allow add/edit multiple record within a form.
Usage
Demo file
multiline.php
Feature