Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. <referenceContainer name="content">
  2. <container name="button.actions.container" label="Container">
  3. all button action here .. such as save, back reset
  4. </container>
  5. <container name="form" label="Form"><!-- this modal form -->
  6. <block class="NamespaceModuleBlockAdminhtmlFormWrapForm" >
  7. <uiComponent name="ui_form"/>
  8. </block>
  9. </container>
  10. </referenceContainer>
  11.  
  12. $meta['add_item_modal']['children']['create_item_form_modal'] = [
  13. 'arguments' => [
  14. 'data' => [
  15. 'config' => [
  16. 'isTemplate' => false,
  17. 'componentType' => ComponentContainer::NAME,
  18. 'dataScope' => 'data.item_form',
  19. 'provider' => 'item_form.megamenu_item_add_form_data_source',
  20. 'options' => [
  21. 'title' => __('Header Title below')
  22. ]
  23. ]
  24. ]
  25. ],
  26. 'children' => [
  27. static::FORM_MODAL_FIELDSET => [
  28. 'arguments' => [
  29. 'data' => [
  30. 'config' => [
  31. 'label' => __('Fieldset'),
  32. 'componentType' => Fieldset::NAME,
  33. 'dataScope' => 'item',
  34. 'collapsible' => true,
  35. 'sortOrder' => 10,
  36. 'opened' => true,
  37. ],
  38. ],
  39. ],
  40. 'children' => [
  41. static::FIELD_NAME_1 => $this->getFirstFieldConfig(10),
  42. static::FIELD_NAME_2 => $this->getSecondFieldConfig(20)
  43. ],
  44. ],
  45. static::ITEM_FORM => $this->getFormConfig() // <== UI FORM
  46.  
  47. ]
  48. ];
  49.  
  50. protected function getFormConfig()
  51. {
  52. return [
  53. 'arguments' => [
  54. 'data' => [
  55. 'config' => [
  56. 'label' => __('Form'),
  57. 'componentType' => ComponentContainer::NAME,
  58. 'component' => 'Vnecoms_Megamenu/js/form/components/item-insert-form',
  59. 'dataScope' => '',
  60. 'ns' => static::ITEM_FORM,
  61. 'update_url' => $this->urlBuilder->getUrl('mui/index/render'),
  62. 'render_url' => $this->urlBuilder->getUrl(
  63. 'mui/index/render_handle',
  64. [
  65. 'handle' => 'megamenuadmin_item_form',
  66. 'buttons' => 1
  67. ]
  68. ),
  69. 'autoRender' => false,
  70. 'externalProvider' => static::ITEM_FORM
  71. . '.megamenu_item_add_form_data_source',
  72. 'toolbarContainer' => '${ $.parentName }',
  73. 'formSubmitType' => 'ajax',
  74. 'imports' => [
  75. ],
  76. 'exports' => [
  77. ]
  78. ]
  79. ]
  80. ]
  81. ];
  82. }
  83.  
  84. <page>
  85. <referenceContainer name="content">
  86. <uiComponent name="megamenu_item_add_form"/>
  87. </referenceContainer>
  88. </page>
  89.  
  90. define([
  91. 'Magento_Ui/js/form/components/insert-form'
  92. ], function (InsertForm) {
  93. 'use strict';
  94.  
  95. return InsertForm.extend({
  96. defaults: {
  97. modules: {
  98. itemForm: 'item_form.item_form'
  99. },
  100. listens: {
  101.  
  102. },
  103. itemId: 0
  104. }
  105.  
  106. });
  107. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement