@hui 请问在formView.extend中alert('append after---');不执行的原因是什么?
W
Wangliun
@Wangliun
-
web js extend -
odoo应用商城下载的tree视图扩展web_tree_resize_column,安装后不生效,麻烦朋友们帮忙看看是什么原因<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>
-
odoo应用商城下载的tree视图扩展web_tree_resize_column,安装后不生效,麻烦朋友们帮忙看看是什么原因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