I need to be able to pass data between a controller and a js file to be used within the js. What I've done as a hack is to have the controller pass the data to the view, where the view outputs the value to an empty span tag with the data as an attribute, where the js can then target that span tag and retrieve the data.....but there has to be a better way?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
Hello John Wiltshire,
You can give a class for your span tag and add data id using qweb in xml
xml code:
then in js give any click event for that class
js code:
events: {
"click .your_class": "your_function",
},
your_function: function () {
console.log('Clicked Class');
//Here you give a data id for span tag
}
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
1
nov. 19
|
4525 | ||
|
0
août 24
|
1475 | ||
|
0
avr. 23
|
442 | ||
|
2
déc. 22
|
2153 | ||
|
1
juin 21
|
8872 |