Skip to Content
Menu
This question has been flagged
3354 Zobrazenia

Hi, i have a view that has a couple of fields, including a one2many field that I show using a tree:


tree editable="bottom">

field name="sequence" widget="handle"/>

field name="crane_type_id"/>

field name="crane_span"/>

field name="crane_length"/>

button class="btn-primary" id="insidetree" string="TEST" type="object" name="get_token_from_type_line"/>

/tree>


    

I also have a javascript file that would add an event to this button when clicked, but this is not working. To test I made a new button that i put outside of the tree view and this one does do the function, but the one inside the listview does not work.


Here is the javascript code:

var ActionManager = require('web.ActionManager');

ActionManager.include({

events:{

'click #outsidetree': '_executeURLAction',

'click #insidetree': '_test'

},

_executeURLAction: function (element) {

console.log("test outside, this works")

console.log(element)

},

_test: function (element) {

console.log("test inside, does not work")

}

})


I already tried adding eventlisteners on load, normal onload, DOMcontentloaded and tried checking the onreadystatechange, but none of that helps in that regard. Do buttons inside tree views just not work?

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
1
aug 23
3461
1
máj 23
3371
1
jan 24
2054
0
máj 23
1615
2
dec 22
5024