This topic contains 2 replies, has 2 voices, and was last updated by sad270 7 years, 12 months ago.
- Topic
Hi,
I have a create button which opens a dialog this way:
12345678910111213141516171819202122232425262728{% if resource_granted('mekit_task_worklog_create') %}{% set dialogTitle = 'mekit.task.worklog.widgets.worklog_add.title'|trans %}{{ UI.clientButton({'dataUrl': path('mekit_worklog_create', { 'taskId': entity.id }),'aCss': 'no-hash','iCss': 'icon-plus-sign','dataId': entity.id,'title' : dialogTitle,'label' : dialogTitle,'widget' : {'type' : 'dialog','multiple' : false,'reload-grid-name' : 'worklogs-related-to-task','options' : {'alias': 'worklog-dialog','stateEnabled': false,'dialogOptions' : {'title' : dialogTitle,'allowMaximize': false,'allowMinimize': false,'width': 600}}}}) }}{% endif %}after save the underlying “worklogs-related-to-task” is correctly reloaded and I can see the persisted entity.
now I am trying to implement the edit functionality on the datagrid “worklogs-related-to-task” where I have:
123456789101112131415actions:update:type: dialogacl_resource: mekit_task_worklog_updatelabel: oro.grid.action.updateicon: editlink: update_linkwidget:title: "My Title #1"reload-grid-name: worklogs-related-to-taskoptions:dialogOptions:title: "My Title #2"The dialog opens correctly, and all is fine except:
1) I cannot set the title of the dialog
2) after save the “worklogs-related-to-task” datagrid is not reloadedIf, after save, I click the referesh button on the datagrid I can correcly see my persisted changes.
Q1) Is this possible to do this with datagrid? If yes, could you tell me what am I doing wrong?
Q2) If it is not possible, I guess I need to implement the datagrid reload in my update.html.twig which is loaded into the dialog.
this is what I have:
12345678910111213141516171819202122232425262728293031323334353637383940414243{% form_theme form with ['OroFormBundle:Form:fields.html.twig', _self] %}<div class="widget-content">{% if saved %}<script type="text/javascript">require(['underscore', 'orotranslation/js/translator', 'oroui/js/widget-manager','oroui/js/messenger', 'oroui/js/mediator'],function(_, __, widgetManager, messenger, mediator) {widgetManager.getWidgetInstance({{ app.request.get('_wid')|json_encode|raw }}, function(widget) {messenger.notificationFlashMessage('success', __('Worklog saved successfully'));mediator.trigger('widget_success:' + widget.getAlias());mediator.trigger('widget_success:' + widget.getWid());//mediator.trigger('datagrid:doRefresh: worklogs-related-to-task'); - This does not workwidget.remove();});});</script>{% else %}{% if not form.vars.valid and form.vars.errors|length %}<div class="alert alert-error"><div class="message">{{ form_errors(form) }}</div></div>{% endif %}<div class="form-container"><form id="{{ form.vars.name }}" action="{{ formAction }}" method="post" class="listitem-form"><fieldset class="form-horizontal">{{ form_row(form.duration) }}{{ form_row(form.description) }}{{ form_row(form.executionDate) }}{{ form_row(form.owner) }}{{ form_rest(form) }}<div class="widget-actions form-actions" style="display: none;"><button class="btn" type="reset">{{ 'Cancel'|trans }}</button><button class="btn btn-primary" type="submit">{{ 'Save'|trans }}</button></div></fieldset></form>{{ oro_form_js_validation(form) }}</div>{% endif %}</div>Thanks
a\oro/platform(1.6.2) + oro/doctrine-extensions(1.0.7) + symfony/symfony(v2.3.27)
The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.