Another datepicker / DataTables conflict?

Another datepicker / DataTables conflict?

radu.cruceanaradu.cruceana Posts: 6Questions: 1Answers: 0
edited October 2017 in Free community support

Hello dear all,

First of all I'm less than beginner on dev.
I'm using Laravel 5.4, in master template I have the following scripts inclusions:

<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
<script src="js\DataTables-1.10.15\DataTables.js"></script>
<script src="js\bootstrap-dropdownhover.min.js"></script>
<script src="js\scripts.js"></script>
<script src="js\SweetAlert\sweetalert.min.js"></script>

In html view:

<form>
 <input  id="dataFabricatiei" name="dataFabricatiei" type="date"/>
</form>

In scripts.js

  $('#dataFabricatiei').datepicker();

I get this error in browser console and datatable don't work animore:

scripts.js:28 Uncaught TypeError: $(...).datepicker is not a function
at HTMLDocument.<anonymous> (scripts.js:28)
at fire (DataTables.js:3244)
at Object.fireWith [as resolveWith] (DataTables.js:3374)
at Function.ready (DataTables.js:3594)
at HTMLDocument.completed (DataTables.js:3629)
(anonymous) @ scripts.js:28
fire @ DataTables.js:3244
fireWith @ DataTables.js:3374
ready @ DataTables.js:3594
completed @ DataTables.js:3629

Thank you for your time,

Radu Cruceana
:smile:

Replies

  • radu.cruceanaradu.cruceana Posts: 6Questions: 1Answers: 0

    I've got it!
    Data Tables should be included BEFORE Bootstrap date-picker
    Correct order is:

    <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <script src="js\DataTables-1.10.15\DataTables.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
    <script src="js\bootstrap-dropdownhover.min.js"></script>
    <script src="js\scripts.js"></script>
    <script src="js\SweetAlert\sweetalert.min.js"></script> 
    
  • allanallan Posts: 63,468Questions: 1Answers: 10,466 Site admin

    Thanks for posting back. Good to hear you've got it working.

    Allan

  • radu.cruceanaradu.cruceana Posts: 6Questions: 1Answers: 0

    Thank you Allan.
    And thank you for such an awesome product!
    can you please help me with my new question?
    I badly need to end this project :)

This discussion has been closed.