diff options
| author | Xavier Morel <xmo@openerp.com> | 2013-05-30 12:04:20 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2013-05-30 12:04:20 +0200 |
| commit | c0807b34b10d1d8fce8ed1554ba9dd62e933c9d4 (patch) | |
| tree | 220003d3a0165fa03e926e3ee0faae3dd0aeb5f0 /addons/web/static/src/js/data_export.js | |
| parent | 398f570e69637c5543b2bbe3e2bd0b23a3090d93 (diff) | |
[IMP] export view: use events hash
bzr revid: xmo@openerp.com-20130530100420-8zsa03ssom8ox2g4
Diffstat (limited to 'addons/web/static/src/js/data_export.js')
| -rw-r--r-- | addons/web/static/src/js/data_export.js | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/addons/web/static/src/js/data_export.js b/addons/web/static/src/js/data_export.js index c7971371bef..fb5e391effd 100644 --- a/addons/web/static/src/js/data_export.js +++ b/addons/web/static/src/js/data_export.js @@ -4,6 +4,25 @@ var QWeb = instance.web.qweb, instance.web.DataExport = instance.web.Dialog.extend({ template: 'ExportTreeView', dialog_title: {toString: function () { return _t("Export Data"); }}, + events: { + 'click #add_field': function () { + var self = this; + this.$('#field-tree-structure tr.ui-selected') + .removeClass('ui-selected') + .find('a').each(function () { + var id = $(this).attr('id').split('-')[1]; + var string = $(this).attr('string'); + self.add_field(id, string); + }); + }, + 'click #remove_field': function () { + this.$('#fields_list option:selected').remove(); + }, + 'click #remove_all_field': function () { + this.$('#fields_list').empty(); + }, + 'click #export_new_list': 'on_show_save_list', + }, init: function(parent, dataset) { var self = this; var options = { @@ -23,22 +42,6 @@ instance.web.DataExport = instance.web.Dialog.extend({ var self = this; this._super.apply(this, arguments); self.$el.removeClass('ui-dialog-content ui-widget-content'); - self.$el.find('#add_field').click(function() { - self.$('#field-tree-structure tr.ui-selected') - .removeClass('ui-selected') - .find('a').each(function () { - var id = $(this).attr('id').split('-')[1]; - var string = $(this).attr('string'); - self.add_field(id, string); - }); - }); - self.$el.find('#remove_field').click(function() { - self.$el.find('#fields_list option:selected').remove(); - }); - self.$el.find('#remove_all_field').click(function() { - self.$el.find('#fields_list').empty(); - }); - this.$el.find('#export_new_list').click(this.on_show_save_list); var got_fields = new $.Deferred(); this.$el.find('#import_compat').change(function() { |
