Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3740

$.fn.dataTable.Editor is not a constructor (Trial installed today, 20/09/2021)

$
0
0

Below is my code, very simple; but for some reason i am getting the following error:

jquery-3.5.1.js:4055 Uncaught TypeError: $.fn.dataTable.Editor is not a constructor
at HTMLDocument.<anonymous> (home:262)
at mightThrow (jquery-3.5.1.js:3762)
at process (jquery-3.5.1.js:3830)

I have tried a lot of different solutions on the internet but no luck, different documentation asks you to use different cdns / local files but none work unfortunately.

some help regarding this would be extremely helpful.

<div class="container-fluid">
    <div class="row mb-4">
        <div class="col-lg-12 col-md-12 mb-12">
            <div class="card">
                <div class="card-body">


                    <table id="data-table" class="table table-striped table-valign-middle">
                        <thead class="thead-light">
                            <tr>
                                <th> First Name </th>
                                <th> Second Name </th>
                                <th> Email </th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

    </div>
</div>





<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.11.0/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/2.0.0/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/select/1.3.3/js/dataTables.select.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/datetime/1.1.1/js/dataTables.dateTime.min.js"></script>

<script type="text/javascript" src="Editor-2021-10-05-2.0.5/js/dataTables.editor.min.js"></script>






<script>


var editor; // use a global for the submit and return data rendering in the examples


$(document).ready(function () {


    editor = new $.fn.dataTable.Editor( {
        ajax: "/home/getData",
        table: "#data-table",
        fields: [ {
                label: "First name:",
                name: "firstName"
            }, {
                label: "Last name:",
                name: "lastName"
            }, {
                label: "Email:",
                name: "email"
            }
        ]
    } );

})
<script>

Viewing all articles
Browse latest Browse all 3740

Trending Articles