Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
5461 Prikazi

Hello,

I want to customize the web module list View in a way that a JS function is triggered when the List View is finihed loading.

Is there a propper way to do that or do I have to check the WebModule List View JS to find the right place to set my trigger.

Help is apprichiated...

Greetz

Peter

Avatar
Opusti
Avtor Best Answer

This does the trick. I create a new custom list view inherited from the old one and override reload_content():

[...]
    instance.web.views.add('custom_list', 'instance.web.CustomListView');
    instance.web.CustomListView = instance.web.ListView.extend({

        reload_content: function () {
            var self = this;
            this.conf_model = new instance.web.Model('customer_stats.config');
            this._super.apply(this, arguments);
            custom.whatever();    //this will get called everytime the list is loaded, reloaded or changed
       }
[...]

In the "my_view.xml" action section (ir.action.act.window) custom_list needs to be used instead of list or tree.

[...]<field name="view_mode">custom_list, form,kanban,graph</field>[...]

Avatar
Opusti