Skip to Content
Menu
This question has been flagged
1 Atsakyti
4179 Rodiniai

Here is my code to inherit ListRenderer but main function keeps working as it is and my super is not working, Here is my code

/** @odoo-module */

import { ListRenderer } from "@web/views/list/list_renderer";

const { useEffect } = owl;

export class NewListRenderer extends ListRenderer {
setup() {
super.setup();
console.log('uhuhuhu');
this.creates = this.props.archInfo.creates.length
? this.props.archInfo.creates
: [{ type: "create", string: env._t("Add a line++++") }]; }


}

and i have called it in manifest like 

'assets': {
'web.assets_backend': [
'med_exam/static/src/list_render.js',
],

},

Cann anyone explain why it is not working? Thanks,

Portretas
Atmesti
Best Answer

Hi,

You can try adding it to the registry.Here's an example for you to refer: 


import { registry } from "@web/core/registry";
import { listView } from "@web/views/list/list_view";
import { ListRenderer } from "@web/views/list/list_renderer";

export class NewListRenderer extends Component {
    setup() {
         //Your code...    }}
export const newListView = {
    ...listView,
    Renderer: NewListRenderer,
};

registry.category("views").add("new_list_view", newListView);

Portretas
Atmesti
Autorius

Hey thanks for replying, so we don't need to use super function?

Related Posts Replies Rodiniai Veikla
1
saus. 25
1532
1
birž. 24
3263
2
bal. 24
3197
0
gruod. 23
1727
1
spal. 23
3265