mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[IMP] using qweb template in _format function instead of return the html part directly
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user