Просмотр исходного кода

[minor] print_template and frappe.render_grid fixes (#3476)

version-14
Makarand Bauskar 8 лет назад
committed by Nabin Hait
Родитель
Сommit
fdd6873c5e
2 измененных файлов: 13 добавлений и 8 удалений
  1. +11
    -8
      frappe/public/js/frappe/views/reports/query_report.js
  2. +2
    -0
      frappe/public/js/lib/microtemplate.js

+ 11
- 8
frappe/public/js/frappe/views/reports/query_report.js Просмотреть файл

@@ -188,19 +188,20 @@ frappe.views.QueryReport = Class.extend({
if(this.html_format) { if(this.html_format) {
var content = frappe.render(this.html_format, { var content = frappe.render(this.html_format, {
data: frappe.slickgrid_tools.get_filtered_items(this.dataView), data: frappe.slickgrid_tools.get_filtered_items(this.dataView),
filters:this.get_values(),
report:this});
filters: this.get_values(),
report: this
});


frappe.render_grid({ frappe.render_grid({
content:content,
title:__(this.report_name),
content: content,
title: __(this.report_name),
print_settings: this.print_settings, print_settings: this.print_settings,
}); });
} else { } else {
frappe.render_grid({ frappe.render_grid({
grid:this.grid,
grid: this.grid,
report: this, report: this,
title:__(this.report_name),
title: __(this.report_name),
print_settings: this.print_settings, print_settings: this.print_settings,
}); });
} }
@@ -233,7 +234,8 @@ frappe.views.QueryReport = Class.extend({
base_url: base_url, base_url: base_url,
print_css: print_css, print_css: print_css,
print_settings: this.print_settings, print_settings: this.print_settings,
landscape: landscape
landscape: landscape,
columns: columns
}); });
} else { } else {
// rows filtered by inline_filter of slickgrid // rows filtered by inline_filter of slickgrid
@@ -257,7 +259,8 @@ frappe.views.QueryReport = Class.extend({
base_url: base_url, base_url: base_url,
print_css: print_css, print_css: print_css,
print_settings: this.print_settings, print_settings: this.print_settings,
landscape: landscape
landscape: landscape,
columns: columns
}); });
} }




+ 2
- 0
frappe/public/js/lib/microtemplate.js Просмотреть файл

@@ -93,6 +93,8 @@ frappe.render_grid = function(opts) {
} else if(opts.grid) { } else if(opts.grid) {
opts.data = opts.grid.getData().getItems(); opts.data = opts.grid.getData().getItems();
} }
} else {
opts.columns = [];
} }


// show landscape view if columns more than 10 // show landscape view if columns more than 10


Загрузка…
Отмена
Сохранить