mirror of
https://github.com/pcvolkmer/onkostar-plugin-dnpm.git
synced 2025-07-03 01:32:55 +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;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const request = function (query) {
|
const request = function (query, includeInactive) {
|
||||||
if (pluginRequestsDisabled) return;
|
if (pluginRequestsDisabled) return;
|
||||||
executePluginMethod(
|
executePluginMethod(
|
||||||
'EinzelempfehlungAnalyzer',
|
'EinzelempfehlungAnalyzer',
|
||||||
'getStudien',
|
'getStudien',
|
||||||
{q: query},
|
includeInactive ? {q: query, inactive: true} : {q: query},
|
||||||
function (response) {
|
function (response) {
|
||||||
if (response.status.code < 0) {
|
if (response.status.code < 0) {
|
||||||
onFailure();
|
onFailure();
|
||||||
@ -110,6 +110,7 @@ const save = (selectedItemIndex) => {
|
|||||||
const showDialog = function (blockIndex) {
|
const showDialog = function (blockIndex) {
|
||||||
let selectedItemIndex = -1;
|
let selectedItemIndex = -1;
|
||||||
let queryString = '';
|
let queryString = '';
|
||||||
|
let includeInactive = false;
|
||||||
|
|
||||||
const gridColumns = [
|
const gridColumns = [
|
||||||
{header: 'Kategorie', width: 80, sortable: false, dataIndex: 'kategorieName'},
|
{header: 'Kategorie', width: 80, sortable: false, dataIndex: 'kategorieName'},
|
||||||
@ -128,7 +129,20 @@ const showDialog = function (blockIndex) {
|
|||||||
listeners: {
|
listeners: {
|
||||||
change: (f) => {
|
change: (f) => {
|
||||||
queryString = f.value;
|
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',
|
type: 'vbox',
|
||||||
align: 'stretch'
|
align: 'stretch'
|
||||||
},
|
},
|
||||||
items: [query, availableGrid]
|
items: [query, inactiveSelection, availableGrid]
|
||||||
});
|
});
|
||||||
|
|
||||||
Ext.create('Ext.window.Window', {
|
Ext.create('Ext.window.Window', {
|
||||||
|
Reference in New Issue
Block a user