Skip to content
  • Categories
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse

Odoo 中文社区

  1. Home
  2. Categories
  3. Odoo 新手求助
  4. odoo应用商城下载的tree视图扩展web_tree_resize_column,安装后不生效,麻烦朋友们帮忙看看是什么原因

odoo应用商城下载的tree视图扩展web_tree_resize_column,安装后不生效,麻烦朋友们帮忙看看是什么原因

Scheduled Pinned Locked Moved Odoo 新手求助
2 Posts 1 Posters 465 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wangliun
    wrote on last edited by Wangliun
    #1
    odoo.define('web_tree_resize_column.backend', function (require) {
        "use strict";
        var ListRenderer = require('web.ListRenderer');
    
        ListRenderer.include({
    
            /**
             * @override
             */
            _renderView: function() {
                // Preserve width of columns
                var styles = [];
                this.$el.find('thead th').each(function () {
                    styles.push($(this).attr('style'));
                });
    
                var res = this._super.apply(this, arguments);
    
                // Initialize jQuery plugin
                this.$el.find('table').resizableColumns();
    
                // Restore width of columns
                this.$el.find('thead th').each(function (index, th) {
                    $(th).attr('style', styles[index]);
                });
    
                return res;
            },
    
            /**
             * Prevent sorting when the user is resizing a column.
             *
             * @override
             */
            _onSortColumn: function (event) {
                if ($(event.target).is('.resizer')) {
                    return;
                }
    
                this._super.apply(this, arguments);
            },
        });
    });```
    code_text
    
    W 1 Reply Last reply
    0
    • W Offline
      W Offline
      Wangliun
      replied to Wangliun on last edited by
      #2
      <odoo>
          <template id="assets_backend" inherit_id="web.assets_backend">
              <xpath expr=".">
                  <script src="/web_tree_resize_column/static/lib/resizableColumns/jQuery.resizableColumns.js"></script>
      
                  <script src="/web_tree_resize_column/static/src/js/backend.js"></script>
              </xpath>
          </template>
      </odoo>
      
      1 Reply Last reply
      0

      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Tags
      • Popular
      • Users
      • Groups