mirror of https://github.com/OCA/web.git
[IMP] using qweb template in _format function instead of return the html part directly
parent
95d4c115d9
commit
46bd506729
|
@ -6,11 +6,10 @@ openerp.web_widget_radio_tree = function (instance) {
|
|||
|
||||
instance.web.list.RadioTreeColumn = instance.web.list.Column.extend({
|
||||
_format: function (row_data, options) {
|
||||
return _.template(
|
||||
'<input type="radio" name="<%-name%>" <%-checked%> readonly="readonly"></input>', {
|
||||
name: options.model + '_' + this.id,
|
||||
checked: row_data[this.id].value ? 'checked' : '',
|
||||
});
|
||||
return QWeb.render('RadioTreeColumn', {
|
||||
name: options.model + '_' + this.id,
|
||||
checked: row_data[this.id].value ? {checked: ''} : {},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates>
|
||||
<t t-name="RadioTreeColumn"
|
||||
><input type="radio" t-att-name="name" t-att="checked" readonly="readonly"></input>
|
||||
</t>
|
||||
<t t-name="RadioTree">
|
||||
<span class="oe_form_field oe_form_field_boolean oe_form_field_boolean_radio"
|
||||
t-att-style="widget.node.attrs.style">
|
||||
|
|
Loading…
Reference in New Issue