[IMP] web: add className getter in list view
Before this commit, the kanban view has a `className` getter to easily add a class if needed. The list view only uses the className given in the props and so className is added in the view. This commit adds a className getter to be consistent with kanban view and to allow to easily add a className to a specific case (that is for an eventual customization). task-2713538 Part-of: odoo/odoo#98380
This commit is contained in:
@@ -279,6 +279,10 @@ export class ListController extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
get className() {
|
||||
return this.props.className;
|
||||
}
|
||||
|
||||
get nbSelected() {
|
||||
return this.model.root.selection.length;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-name="web.ListView" owl="1">
|
||||
<div t-att-class="props.className" t-ref="root">
|
||||
<div t-att-class="className" t-ref="root">
|
||||
<Layout className="model.useSampleModel ? 'o_view_sample_data' : ''" display="props.display">
|
||||
<t t-set-slot="layout-buttons">
|
||||
<t t-if="env.isSmall and nbSelected">
|
||||
|
||||
Reference in New Issue
Block a user