Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
4052 Visualizações

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
Cancelar
Melhor resposta

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
Cancelar
Autor

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

Publicações relacionadas Respostas Visualizações Atividade
1
jan. 25
1330
1
jun. 24
3149
2
abr. 24
3089
0
dez. 23
1666
1
out. 23
3191