symfony - How to add an autocomplete field in forms Symfony2? -
actually, can assign task user in edition task. display dropdown list of user in system when edit task. now, able display text input autocomplete user, , able add user if not exist.
how that?
thanks in advance.
two things need do:
1) create data transformer
hich let use input field instead of default dropdown linked entity.
the data transformer transforms input (in case username string) actual user object can store entity. let define input field instead of default dropdown linked entity. have @ the documentation, it's pretty straight forward.
2) create ajax autocomplete
this can done using library want (jquery, prototype etc.) on client side, , server side handle in controller action , replies either json or rendered template. there plenty of tutorials out there. ajax result include link create new user, if none found.
the data transformer need focus on, , working before working on ui.
Comments
Post a Comment