Skip to Content
Menu
This question has been flagged

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,

Avatar
Discard
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);

Avatar
Discard
Author

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

Related Posts Replies Views Activity
1
Jan 25
1495
1
Jun 24
3239
2
Apr 24
3170
0
Dec 23
1708
1
Oct 23
3233