does not work initialization modal
See original GitHub issue<div id="data_modal" class="modal">
<div class="modal-content">
<h4>Modal Header</h4>
<div class="row">
<div class="col l12">
A bunch of text
</div>
</div>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat" id="save_frame">Сохранить</a>
</div>
</div>
<script type="text/javascript">
// заполняем и открываем модалочку
function _show_data_modal(_in){
var _elem = $('#data_modal');
var modal = M.Modal.getInstance(_elem);
// _elem.children('.modal-content').html('<h4>' + _in['title'] + '</h4>')
_elem.children('.modal-content').html(_in['content']);
modal.open();
}
</script>
===error
Uncaught TypeError: Cannot read property ‘open’ of undefined at _show_data_modal (lm=doc_edit&did=1:183) at eval (eval at success (scripts.js?v1522782874:20), <anonymous>:1:1) at Object.success (scripts.js?v1522782874:20) at i (jquery-3.2.1.min.js:2) at Object.fireWith [as resolveWith] (jquery-3.2.1.min.js:2) at A (jquery-3.2.1.min.js:4) at XMLHttpRequest.<anonymous> (jquery-3.2.1.min.js:4)
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
bootstrap modal not working at all - Stack Overflow
Before posting my complete solution i would like to know , have you initialized your modal before loading it. Initialization:- $(function(){ ...
Read more >Why can't DataTable get initialized properly in modal dialog
I am working on an application built in ASP.NET Core MVC and It has few modal popups displayed with datatables inside.
Read more >Bootstrap JS Modal Reference - W3Schools
The Modal plugin is a dialog box/popup window that is displayed on top of the current page. For a tutorial about Modals, read...
Read more >Problem with dynamic input fields labels initialization insi
I have a problem with dynamic input fields labels initialization inside a modal form loaded by ajax. I have tried to initialize the...
Read more >Dialog Widget | jQuery UI API Documentation
Modal dialogs additionally prevent mouse users from clicking on elements ... Note: The appendTo option should not be changed while the dialog is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://codepen.io/Dogfalo/pen/xYXwoe
You can use this
Get element by ID
var elems = document.getElementById('idDivModal');
The next method is OPTIONAL
With this method you can reconfigure your DIV MODAL and you can add more options
New instance
var instance = M.Modal.getInstance(elems);
instance.open(); // instance with methods