This topic contains 6 replies, has 4 voices, and was last updated by franconob 7 years ago.
- Topic
Hi there. I’m adding a new button to the navbar using the UI.clientButton macro and the following code:
123456789101112131415161718192021222324252627{% import 'OroUIBundle::macros.html.twig' as UI %}<div class="btn-group">{{ UI.clientButton({'dataUrl': path('orob2b_account_account_user_create', {'accountId': entity.id}),'aCss': 'no-hash btn','iCss': 'icon-plus','dataId': entity.id,'label' : 'Agregar usuario a cuenta'|trans,'widget' : {'type' : 'dialog','multiple' : false,'reload-grid-name': 'account-user-by-account-grid','options' : {'alias': 'account-user-dialog','dialogOptions' : {'stateEnabled': false,'incrementalPosition': false,'title' : 'titulo','modal': true,'dblclick': 'maximize','maximizedHeightDecreaseBy': 'minimize-bar','width': 600,}}}}) }}</div>I didn’t have to create a new template, I’m using the default OroB2BAccountBundle:AccountUser:update.html.twig. The form displays just fine, and I’m able to submit the form and save the entity. But when I do that, the dialog remains opened, displaying an empty page and looking at the network console on Chrome, I see the following code:
1234567891011121314<div class="widget-content"><script type="text/javascript">require(['oroui/js/widget-manager'],function(widgetManager) {widgetManager.getWidgetInstance("dfac0f57-992d-4123-aeb2-25406d328819",function (widget) {widget.trigger('formSave', 15);});});</script></div>I found out that the previous code belongs to the OroUIBundle:actions:update.html.twig template.
My question are:
1) Should ORO close the dialog widget automatically?
2) There is a datagrid with the id account-user-by-account-grid in the same page that is not being reloaded after form submission. What I’m doing wrong?
3) What does the widget.trigger(‘formSave’) trigger does? Do I have to listen manually to this event?Thanks!
The forum ‘OroPlatform – HTML, JavaScript, CSS, Design Questions’ is closed to new topics and replies.