modal is not a function at Object.open

modal is not a function at Object.open

fuerufueru Posts: 4Questions: 1Answers: 0
edited July 2017 in Free community support

Hi Allan and DT team!

first, we're proud of using (and purchasing) Datatables, big fans of your product B) !

So, we've joined successfully 3 tables, we have in our project:
- nodes table referencing location id and type ids
- types table
- locations table

And problem is that we cannot edit/create/delete any field... and we get the image attached as a console error...

Attaching too the Debugger data: http://debug.datatables.net/osavir just in case it helps too :smile:

I would say that all bootstrap and jquery are correctly loaded on page... but do you think this error is only caused by that?

I'm using symfony (without assetic, just using asset() locations) and all js and css are correctly loaded (attaching too 'js files used.png))

I believe is something stupid, but can't find in forums any further info...

slàinte!

This question has an accepted answers - jump to answer

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    You need DataTables' Buttons extension - it doesn't seem to be among your js inclusions.

  • fuerufueru Posts: 4Questions: 1Answers: 0

    Hey Tangerine!

    thanks but yes it was, sorry the image was cutted due to its length, but in the debug we can see its enabled. (attaching image with it proof)

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    My apologies, I should have thought to check the debugger info.

  • kthorngrenkthorngren Posts: 21,919Questions: 26Answers: 5,066
    Answer ✓

    A google search indicates this error could be caused by loading jQuery twice. You are loading jQuery in the first line of your PNG. Are you loading it on another line in your page?

    Kevin

  • fuerufueru Posts: 4Questions: 1Answers: 0

    @tangerine , no problem dude, thanks for trying though

    @kthorngren, kudos for you! that solved the issue! :smile:

    (attaching proof as image)

  • lenebormaleneborma Posts: 1Questions: 0Answers: 0

    The $(…).modal is not a function is usually caused because scripts are loaded in the wrong order . The browser will execute the scripts in the order it finds them. If in a script you attempt to access an element that hasn't been reached yet then you will get an error. Make sure that you don't have a script above one that it requires.

    Multiple jQuery instances

    Sometimes this warning may also be shown if jQuery is declared more than once in your code. The second jQuery declaration prevents bootstrap.js from working correctly. The problem is due to having jQuery instances more than one time. Take care if you are using many files with multiples instance of jQuery. Just leave one instance of jQuery and your code will work.

This discussion has been closed.