콘텐츠로 건너뛰기
메뉴
신고된 질문입니다

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?

아바타
취소
베스트 답변

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

아바타
취소
관련 게시물 답글 화면 활동
1
11월 19
4515
0
8월 24
1472
0
4월 23
442
2
12월 22
2152
1
6월 21
8864