Reportview fixes (#5582)
* Reportview- Dynamic row height disabled by default, enable using checkbox * Always show filter row in Query Report
This commit is contained in:
parent
2f1f174bfd
commit
8689bbd855
3 changed files with 46 additions and 7 deletions
|
|
@ -36,9 +36,6 @@ frappe.ui.form.ControlAutocomplete = frappe.ui.form.ControlData.extend({
|
|||
value: item.value
|
||||
};
|
||||
},
|
||||
filter: function() {
|
||||
return true;
|
||||
},
|
||||
item: function(item) {
|
||||
var d = this.get_item(item.value);
|
||||
if(!d) {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
|
|||
setup_view() {
|
||||
this.setup_columns();
|
||||
this.bind_charts_button();
|
||||
this.setup_dynamic_row_height_check();
|
||||
}
|
||||
|
||||
setup_result_area() {
|
||||
|
|
@ -77,13 +78,13 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
|
|||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
render(force) {
|
||||
if (this.data.length === 0) return;
|
||||
|
||||
if (this.chart) {
|
||||
this.refresh_charts();
|
||||
}
|
||||
if (this.datatable) {
|
||||
if (this.datatable && !force) {
|
||||
this.datatable.refresh(this.get_data(this.data));
|
||||
return;
|
||||
}
|
||||
|
|
@ -147,11 +148,12 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
|
|||
}
|
||||
|
||||
setup_datatable(values) {
|
||||
this.$datatable_wrapper.empty();
|
||||
this.datatable = new DataTable(this.$datatable_wrapper[0], {
|
||||
columns: this.columns,
|
||||
data: this.get_data(values),
|
||||
getEditor: this.get_editing_object.bind(this),
|
||||
dynamicRowHeight: true,
|
||||
dynamicRowHeight: !this.fixed_row_height.get_value(),
|
||||
checkboxColumn: true,
|
||||
events: {
|
||||
onRemoveColumn: (column) => {
|
||||
|
|
@ -820,6 +822,23 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
|
|||
});
|
||||
}
|
||||
|
||||
setup_dynamic_row_height_check() {
|
||||
this.fixed_row_height = frappe.ui.form.make_control({
|
||||
df: {
|
||||
fieldtype: 'Check',
|
||||
fieldname: 'fixed_row_height',
|
||||
label: __('Fixed height'),
|
||||
onchange: () => {
|
||||
this.render(true);
|
||||
}
|
||||
},
|
||||
parent: this.$paging_area.find('.level-left'),
|
||||
render_input: true
|
||||
});
|
||||
this.fixed_row_height.$wrapper.addClass('report-action-checkbox');
|
||||
this.fixed_row_height.set_value(1);
|
||||
}
|
||||
|
||||
get_checked_items(only_docnames) {
|
||||
const indexes = this.datatable.rowmanager.getCheckedRows();
|
||||
const items = indexes.filter(i => i != undefined)
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@
|
|||
margin-top: -1px;
|
||||
font-size: @text-medium;
|
||||
|
||||
.frappe-control {
|
||||
.frappe-control, .form-control {
|
||||
margin: 0;
|
||||
border-radius: 0px;
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
|
|
@ -52,12 +53,34 @@ table td.dt-cell {
|
|||
.dt-header {
|
||||
background-color: @panel-bg;
|
||||
color: @text-muted;
|
||||
|
||||
.dt-row[data-is-filter] {
|
||||
display: table-row !important;
|
||||
}
|
||||
}
|
||||
|
||||
.dt-row.row-update {
|
||||
animation: 500ms breathe forwards;
|
||||
}
|
||||
|
||||
.report-action-checkbox {
|
||||
margin: 0;
|
||||
margin-left: 10px;
|
||||
|
||||
.checkbox {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.help-box {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.dt-filter {
|
||||
border: 1px solid @light-border-color;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
@keyframes breathe {
|
||||
0% {
|
||||
background-color: transparent;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue