Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
2439 Представления

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


Аватар
Отменить
Лучший ответ

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

Аватар
Отменить
Лучший ответ

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

Аватар
Отменить
Автор

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

new Tooltip with capital T , you use that ?

Автор

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 **/

Автор Лучший ответ

xml file :


Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
апр. 25
1408
Odoo App Решено
1
нояб. 23
2001
0
мая 24
1722
0
сент. 23
2671
0
сент. 23
2289