brad
April 10, 2019, 5:38pm
1
I have done many data detail regions in modals in the past but haven’t done one for awhile. I am sure I am missing one little thing. I thought there was documentation on data detail regions but I can’t find that either.
I’m sure it is something simple. And it’s too early in the day to start drinking …
t11
April 10, 2019, 5:46pm
2
Create a detail region
Set as source the appconnect action
Set as key the id of the query used in the appconnect action
Check a demo code using data detail inside a modal
<div class="modal fade" id="modal_delete" is="dmx-bs4-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete {{data_detail_subcats.data.subcat_name_gr}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p class="alert alert-danger text-center">
{{data_detail_subcats.data.subcat_name_gr}}<br>
</p>
</div>
<div class="modal-footer">
<form name="del_subcat_form" id="del_subcat_form" role="form" method="post" is="dmx-serverconnect-form" action="dmxConnect/api/back_end/content_subcategories/delete_subcategory.php" dmx-on:start="notifies1.info('Please wait')" dmx-on:error="notifies1.clear();notifies1.danger('Please try again')" dmx-on:success="notifies1.clear();notifies1.success('Deleted');get_subcategories.load({},true);modal_delete.del_subcat_form.reset();modal_delete.hide()">
<input type="hidden" name="del_id" id="del_id" dmx-bind:value="data_detail_subcats.data.subcat_id">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-success">Delete</button>
</form>
</div>
</div>
</div>
</div>
Teodor
April 10, 2019, 5:46pm
3
2 Likes
brad
April 10, 2019, 5:47pm
4
Ah, that's where I have seen it before. Thanks!
1 Like
brad
April 10, 2019, 5:50pm
5
Thanks Nicolaos, that will help.
t11
April 10, 2019, 5:52pm
6
Also the buttons inside the repeat table that trigger the Modal to open and the data detail to select the ‘selected’ from the repeat region row
<button type="button" class="btn btn-link" dmx-on:click="modal_edit.show();data_detail_subcats.select(subcat_id)"> <i class="fa fa-repeat"></i></button>
<button type="button" class="btn btn-link" dmx-on:click="modal_delete.show();data_detail_subcats.select(subcat_id)"> <i class="fa fa-times"></i></button>