feat(data_exporter): add search input for field selection
This commit is contained in:
parent
f5eb47db41
commit
dfd5be5d1e
1 changed files with 25 additions and 1 deletions
|
|
@ -91,12 +91,13 @@ frappe.data_import.DataExporter = class DataExporter {
|
|||
],
|
||||
primary_action_label: __("Export"),
|
||||
primary_action: (values) => this.export_records(values),
|
||||
on_page_show: () => this.select_mandatory(),
|
||||
on_page_show: () => this.setup_on_page_show(),
|
||||
});
|
||||
|
||||
this.make_filter_area();
|
||||
this.make_select_all_buttons();
|
||||
this.update_record_count_message();
|
||||
this.setup_search_input();
|
||||
|
||||
this.dialog.show();
|
||||
}
|
||||
|
|
@ -303,6 +304,29 @@ frappe.data_import.DataExporter = class DataExporter {
|
|||
};
|
||||
});
|
||||
}
|
||||
|
||||
setup_search_input() {
|
||||
const $wrapper = this.dialog.get_field("select_all_buttons").$wrapper;
|
||||
|
||||
// prevent duplicate search inputs
|
||||
if (this.dialog.$wrapper.find(".filters-search").length) return;
|
||||
|
||||
$wrapper.before(`
|
||||
<div class="filters-search">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="${__("Search")}"
|
||||
data-element="search"
|
||||
class="form-control input-xs"
|
||||
>
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
|
||||
setup_on_page_show() {
|
||||
frappe.utils.setup_search(this.dialog.$body, ".unit-checkbox", ".label-area");
|
||||
this.select_mandatory();
|
||||
}
|
||||
};
|
||||
|
||||
export function get_columns_for_picker(doctype) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue