Plugins do not work in my modal window


I have a web app in laravel 5.5, I have several manners for registrations, validation for generic fields such as country I use select2 , and it runs perfect in all views of the application, except in manners, I even tried to place a table with datatable and noticed that it loads the first time (sometimes) and then it does not return to show the stylized table, my JS scripts are in a separate .js file, but as a test I have placed them in the layout /app.blade.php, in the view that calls the modal and in the same modal, none without success, any recommendations?


$( function() {
var countries =   
["Afghanistan","Albania",....,"Venezuela","Vietnam","Virgin Islands 
$( "#pais" ).select2({
  data: countries

layout / app.blade.php

<!-- MODAL-->
<div class="modal fade" id="scrollmodal" tabindex="-1" role="dialog" aria- 
labelledby="scrollmodalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg" role="document">
<!-- END MODAL-->
<script src="{{asset ('js/action.js')}}"></script>

quotations / create.blade.php (view that calls the modal)

<a id="triggerClient" href="#scrollmodal" data-toggle="modal" class="btn 
 btn-success btn-sm">
    <i class="zmdi zmdi-account-add"></i>
$('#triggerClient').on('click', function (event) {
  var button = $(event.relatedTarget); // Button that triggered the modal
    url: '{{route('cliente.create')}}',

      $('#canc').on('click', function (event) { $('.evento').html(''); });


client / create.blade.php

 <div class="modal-dialog modal-lg" role="document">
  <meta name="_token" content="{{ csrf_token() }}"/>
   <div class="modal-content">
    <div class="modal-header">
      <h5 class="modal-title" id="scrollmodalLabel">Crear <b>Cliente</b> 
      <button type="button" class="close" data-dismiss="modal" aria- 
        <span aria-hidden="true">&times;</span>
     <div class="modal-body">
      <form action="" method="post">
        <select name="pais" id="pais">
          <option value="">Seleccione un país</option>
asked by Jhosno 08.11.2018 в 17:07

0 answers