跳至内容
菜单
此问题已终结
3 回复
2444 查看

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 :


形象
丢弃
相关帖文 回复 查看 活动
1
4月 25
1410
Odoo App 已解决
1
11月 23
2008
0
5月 24
1727
0
9月 23
2673
0
9月 23
2297