[英]issue loading js code when Customizing form field symfony/ sonata Admin
i'm trying to customise a field of a form generated with sonata admin bundle, i adopted the solution posted here: Customize form field rendering what i want to do also is to execute an autocomplete script with ajax that load for me possible values for the field i've already created, so iwrote the script in the myfield_edit.html.twig mentionned in the solution. 我正在尝试自定义使用Sonata管理员捆绑包生成的表单的字段,我采用了此处发布的解决方案: 自定义表单字段的呈现方式我想做的也是用ajax执行自动完成脚本,该脚本会为我加载可能的值我已经创建的字段,所以在解决方案中提到的myfield_edit.html.twig中编写了脚本。 My problem: when loading the form page, my script's never been loaded! 我的问题:加载表单页面时,脚本从未加载过! help pleaze! 帮忙吧!
I think you can try things as seen on this page : http://sonata-project.org/bundles/admin/master/doc/reference/form_types.html 我认为您可以尝试在此页面上看到的内容: http : //sonata-project.org/bundles/admin/master/doc/reference/form_types.html
(see SONATA_TYPE_MODEL_AUTOCOMPLETE) (请参阅SONATA_TYPE_MODEL_AUTOCOMPLETE)
sorry i took two long to answer this question, but finally i convinced my boss to update everything for better use of any package in the future. 抱歉,我花了很长时间回答这个问题,但最终我说服老板更新了所有内容,以便将来更好地使用任何软件包。 now the pain is gone. 现在,痛苦消失了。 thank you all for help. 谢谢大家的帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.