Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Web Module List View trigger JS when finished loading

By
Peter Nietz
on 9/12/14, 10:23 AM 647 views

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

0
Peter Nietz
On 3/10/15, 8:35 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 9/12/14, 10:23 AM
Seen: 647 times
Last updated: 3/16/15, 8:10 AM