Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5457 มุมมอง

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

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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>[...]

อวตาร
ละทิ้ง