I'm doing a Django project and i need to insert rows dynamically (ajax) with a dropdown menu for each one. When the content is static it works just fine, but when new data are loaded from ajax, i can't bind it to the dropdown functionality and have a message like :
applyStyle.js:66 Uncaught TypeError: Cannot read property 'setAttribute' of null
at Object.onLoad (applyStyle.js:66)
at index.js:69
at Array.forEach (<anonymous>)
at new t (index.js:67)
at c.t.toggle (dropdown.js:177)
at HTMLAnchorElement.<anonymous> (dropdown.js:328)
at Function.each (jquery-3.3.1.slim.min.js:2)
at w.fn.init.each (jquery-3.3.1.slim.min.js:2)
at w.fn.init.c._jQueryInterface [as dropdown] (dropdown.js:315)
at HTMLAnchorElement.<anonymous> (dropdown.js:472)
When i try to call the dropdown() function to bind it manually, i got the message :
Uncaught TypeError: $dropdown1.dropdown is not a function
Is somebody knows what to do ? Thank you !
Byga