From 5aa9fc98e879b10cc7f45843edf82376d207c72c Mon Sep 17 00:00:00 2001 From: Jerry Jalava Date: Sun, 27 Jan 2008 18:59:19 +0200 Subject: [PATCH] Added possibility to override list headers in export --- js/ajatus.types.js | 10 ++++++++-- js/content_types/expense.js | 3 +++ js/content_types/hour_report.js | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/js/ajatus.types.js b/js/ajatus.types.js index f7bc3c7..95edd35 100644 --- a/js/ajatus.types.js +++ b/js/ajatus.types.js @@ -364,14 +364,20 @@ access_key: 'Ctrl+x' }); $.ajatus.toolbar.show(); - + var on_success = function(data) { + var list_headers = self.list_headers; + if (typeof self.export_list_headers != 'undefined') { + list_headers = self.export_list_headers; + } + var renderer = new $.ajatus.renderer.list( $.ajatus.application_content_area, self, { id: self.name + '_export_list_holder', - show_actions: false + show_actions: false, + headers: list_headers } ); diff --git a/js/content_types/expense.js b/js/content_types/expense.js index 9e24d10..addae7a 100644 --- a/js/content_types/expense.js +++ b/js/content_types/expense.js @@ -127,6 +127,9 @@ this.list_headers = [ 'report_id', 'date', 'title', 'creator' ]; + this.export_list_headers = [ + 'report_id', 'date', 'amount', 'tags', 'creator' + ]; this.tab = { on_click: function(e) { diff --git a/js/content_types/hour_report.js b/js/content_types/hour_report.js index ab94dd1..dad73ba 100644 --- a/js/content_types/hour_report.js +++ b/js/content_types/hour_report.js @@ -78,6 +78,9 @@ this.list_headers = [ 'date', 'title', 'creator' ]; + this.export_list_headers = [ + 'date', 'hours', 'tags', 'creator' + ]; this.list_map = 'map( doc.value.metadata.created.val, {"_type": doc.value._type,'; this.list_map += '"title": doc.value.title,'; -- 2.11.4.GIT