Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
2324 Vistas

Hi

I want to use the https://getbootstrap.com/docs/5.2/components/tooltips/


But when I use it, it gives me an error and says that Bootstrap is unknown

But I use the other features of Bootstrap in the XML file and there is no problem

How can I use the Bootstrap tooltip feature in odoo 16?

Thanks


  • js file:

    const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]') const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))


    in console show: bootstrap is not defined !!!!

xml file: 

after posting remove my code !!
I use the same simple examples from the Bootstrap site


When I try without a JS file and there is only an XML file

Tooltips are displayed, but they do not have the styles that are in  Bootstrap website


Avatar
Descartar
Mejor respuesta

I think it's the same as my problem:
See the proposed solution there:
https://www.odoo.com/de_DE/forum/hilfe-1/use-standard-bootstrap-functionality-270303

Avatar
Descartar
Mejor respuesta

In js i think we only need new Tooltip, check this file https://github.com/odoo/odoo/blob/03856863a644fbc588edb6e63168a6c4e15d5d92/addons/web_editor/static/src/js/editor/snippets.editor.js#L2062

Avatar
Descartar
Autor

tnx.....but I use new tooltip , then get error :
tooltip is not defind

new Tooltip with capital T , you use that ?

Autor

yeah,but get error: Uncaught ReferenceError: Tooltip is not defined;

Is it necessary to use the JS file in certain conditions and types???
(I mean, are there any dependencies from odoo required or not)
Because I have a normal JS file that I linked to XML

Normal js file ?, in order to work your js file need to contain this at the top of the file: /** @odoo-module **/

Autor Mejor respuesta

xml file :


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
abr 25
1266
Odoo App Resuelto
1
nov 23
1824
0
may 24
1518
0
sept 23
2478
0
sept 23
2149