-
Notifications
You must be signed in to change notification settings - Fork 108
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
Dropdown renderRowFunction support for changing values #2172
Comments
The render/parse must play together. Your usecase with The parsing of form submit is currently done in https://github.com/atk4/ui/blob/6c609cfa53/src/Form.php#L439 and the type must match the render type, which is not the case with Also Dropdown related with #1742 |
Does this mean all Dropdown |
Everything works, no issues - actually I am investigating in these situations that you simply change the idField to the tag's The 1:N generally is indeed the logically correct way, I think though that sometimes for coding-speed you just want a simple text field with comma-separated multiple list entries. And the dropdown field offers this as well easily. Ideally the multiple dropdown has two ways of working: either creating the comma-(or whatever-)separated items list (or JSON) OR it populates/edits a hasMany child model. The second option would be really great (off-topic here). |
Let's close it until there is an usecase that someone is willing to pursue. |
Situation:
value
in an individualrenderRowFunction
if theForm\Control\Dropdown
list is populated withmodel
datamultiple
entries and use the model data to offer a selection.Use case:
In this case, you might have a TagsList model which shows you tags like
Likes food
,Is tall
,Is married
, ... if you then populate the field by selecting some tags, the model would store this as "likes food,is married" - exactly how a lot of other software requires tags list (e.g. Mailchimp)Karen Smith X
John Miller X
- this could before easily be implemented by:In latest develop, it is no longer possible to overwrite the returned
value
in arenderRowFunction
, so the above use cases would then always store as lists of model idFields (which often are integers), so the tags list then would store as1,3
and recipient list as23,17
for example in the database.Knowing that the multiple control is developed in a special way still, the general usage and possibilities today are great, flexible and easy-to-code.
If we don't see a good way to keep up the possibility overwriting values for dropdowns with models, for people having the same use cases you can (for example) derive your own dropdown and overwrite the
_addRowCallback
function (see discussion in #1991 (comment)).The text was updated successfully, but these errors were encountered: