-
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
fix/Generic Input onChange event #725
Conversation
- Allow to pass extra argument to onChange event hander.
… into fix/generic-input-onchange
Codecov Report
@@ Coverage Diff @@
## develop #725 +/- ##
=============================================
- Coverage 68.65% 43.16% -25.5%
- Complexity 2055 2059 +4
=============================================
Files 106 106
Lines 4837 4993 +156
=============================================
- Hits 3321 2155 -1166
- Misses 1516 2838 +1322
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## develop #725 +/- ##
=============================================
- Coverage 68.65% 68.61% -0.05%
- Complexity 2055 2058 +3
=============================================
Files 106 106
Lines 4837 4840 +3
=============================================
Hits 3321 3321
- Misses 1516 1519 +3
Continue to review full report at Codecov.
|
demos/invoice-addon.php
Outdated
// 'paymentRelations' => ['invoice_id' => 'id', 'client_id' => 'client_id'], | ||
// 'paymentEditFields' => ['method', 'paid_on', 'amount', 'details'], | ||
// 'paymentDisplayFields' => ['client','balance', 'paid_total','total'], | ||
// ])); |
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.
is that a functional demo? everything is commented apart from a table.
src/FormField/Generic.php
Outdated
@@ -134,10 +134,11 @@ public function renderView() | |||
* | |||
* @param string|jsExpression|array|callable $expr | |||
* @param bool $useDefault |
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.
remove this line.
src/FormField/Generic.php
Outdated
* | ||
* @throws \atk4\ui\Exception | ||
*/ | ||
public function onChange($expr, $useDefault = true) | ||
public function onChange($expr, $useDefault = true, $default = []) |
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.
get rid of 2nd arg
* | ||
* @throws \atk4\ui\Exception | ||
*/ | ||
public function onChange($expr, $useDefault = true) | ||
public function onChange($expr, $useDefault = true, $default = []) | ||
{ | ||
if (is_string($expr)) { | ||
$expr = new \atk4\ui\jsExpression($expr); |
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.
if is_bool($default) {
Codecov Report
@@ Coverage Diff @@
## develop #725 +/- ##
=============================================
- Coverage 68.65% 68.61% -0.05%
- Complexity 2055 2058 +3
=============================================
Files 106 106
Lines 4837 4840 +3
=============================================
Hits 3321 3321
- Misses 1516 1519 +3
Continue to review full report at Codecov.
|
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.
LGTM
ex: When you need to set values of the second Dropdown according to user selected value of the first Dropdown.
This will make $_POST['selected_id'] available in server request callback. Then you can setup other Dropdown values accordingly.