Odoo Help

0

Web Module List View trigger JS when finished loading

By
Peter Nietz
on 9/12/14, 10:23 AM 792 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>[...]

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

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