Impossible to simply install and use datatable editor (laravel 9/npm)

Impossible to simply install and use datatable editor (laravel 9/npm)

beuzathorbeuzathor Posts: 2Questions: 1Answers: 0

Hello,
I end up posting this message because I spent my entire day trying to get the datatable editor to work but without success.

I'm on a brand new install of laravel 9 that I haven't installed anything on. I just set up datatable on USER table and it's ok.

But when i want to use datatable editor (I bought the license today) i have this two error in the console :smile:

app-e6e82434.js:45 jQuery.Deferred exception: $.fn.dataTable.Editor is not a constructor TypeError: $.fn.dataTable.Editor is not a constructor
at HTMLDocument.<anonymous> (http://test88.test/users:67:75)
at Q (http://test88.test/build/assets/app-e6e82434.js:45:31424)
at ae (http://test88.test/build/assets/app-e6e82434.js:45:31749) undefined>

Uncaught TypeError: $.fn.dataTable.Editor is not a constructor
at HTMLDocument.<anonymous> (users:67:75)
at Q (app-e6e82434.js:45:31424)
at ae (app-e6e82434.js:45:31749)>

I installed datatable editor via npm then ran the script so that it puts the files in the right place as shown in the doc
but I have the impression that it does not take into account my files or that it considers that I do not have a license.

I installed the debug script but the link it sends me always gives a 404. The debug script crashes when I'm on the page that tries to display the table of users and when I'm on a classic page it shows me that everything is ok except that datatable editor is not loaded.

I think I've tried everything to load this damn script but I can't. Anyone have any idea what the problem is?

Answers

  • beuzathorbeuzathor Posts: 2Questions: 1Answers: 0
    edited January 2023

    After some research I think the problem comes from jquery.
    If I check I see that jquery is loaded on the page.
    By exemple if i add that in my page it's ok :

    <script type="module">
            $(document).ready(function(){
                $("h1").css('color', 'red');
                $("p").css({ 'color': 'blue', 'font-size': '18px' });
            });
        </script>
    

    On the other hand when I want to launch the debug script it tells me that jquery is not loaded.So i don't know what to think about that.

    Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • allanallan Posts: 61,667Questions: 1Answers: 10,096 Site admin

    I'm guessing that there is probably a bundler somewhere in the mix which is using jQuery.noConflict() to release the window.$ variable.

    Are you able to give me a link to your page so I can take a look at the output and see what might be going wrong and where? You can PM it to me by clicking my name above and then the "Send message" button.

    If that isn't possible, perhaps you could give me the steps to recreate the issue?

    Allan

Sign In or Register to comment.