mirror of
https://github.com/pcvolkmer/onkostar-plugin-dnpm.git
synced 2025-07-02 17:22:54 +00:00
Issue #37: Checkbox zum Einschluss inaktiver Studien in die Suche
This commit is contained in:
@ -66,12 +66,12 @@ const findButtonFieldFormInformation = function(context) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const request = function (query) {
|
||||
const request = function (query, includeInactive) {
|
||||
if (pluginRequestsDisabled) return;
|
||||
executePluginMethod(
|
||||
'EinzelempfehlungAnalyzer',
|
||||
'getStudien',
|
||||
{q: query},
|
||||
includeInactive ? {q: query, inactive: true} : {q: query},
|
||||
function (response) {
|
||||
if (response.status.code < 0) {
|
||||
onFailure();
|
||||
@ -110,6 +110,7 @@ const save = (selectedItemIndex) => {
|
||||
const showDialog = function (blockIndex) {
|
||||
let selectedItemIndex = -1;
|
||||
let queryString = '';
|
||||
let includeInactive = false;
|
||||
|
||||
const gridColumns = [
|
||||
{header: 'Kategorie', width: 80, sortable: false, dataIndex: 'kategorieName'},
|
||||
@ -128,7 +129,20 @@ const showDialog = function (blockIndex) {
|
||||
listeners: {
|
||||
change: (f) => {
|
||||
queryString = f.value;
|
||||
request(f.value);
|
||||
request(queryString, includeInactive);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const inactiveSelection = new Ext.form.field.Checkbox({
|
||||
name: 'inactive',
|
||||
fieldLabel: 'Inaktive Studien einschließen',
|
||||
labelWidth: 240,
|
||||
padding: 8,
|
||||
listeners: {
|
||||
handler: (_, checked) => {
|
||||
includeInactive = checked;
|
||||
request(queryString, includeInactive);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -161,7 +175,7 @@ const showDialog = function (blockIndex) {
|
||||
type: 'vbox',
|
||||
align: 'stretch'
|
||||
},
|
||||
items: [query, availableGrid]
|
||||
items: [query, inactiveSelection, availableGrid]
|
||||
});
|
||||
|
||||
Ext.create('Ext.window.Window', {
|
||||
|
Reference in New Issue
Block a user