Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5459 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ