Archiv des Intrexx Live! Forums

Hier sehen Sie die Foreneinträge aus dem Intrexx Live! Forum. Bis November 2016 war es das Forum für alle Fragen rund um die Software Intrexx von United Planet.
Seit November 2016 gibt es ein neues moderiertes Forum, das Intrexx Community Forum. Nutzen Sie bitte unbedingt dieses für aktuelle Fragen, Antworten und Informationen.

Wichtig: Dieses Forum dient als Archiv. Die Einträge beziehen sich oft auf ältere Versionen von Intrexx und entsprechen nicht mehr den aktuellen technischen Gegebenheiten.
Daher sollten alle Inhalte ausschließlich von Experten genutzt werden. Bei unsachgemäßer Anwendung kann es zu zeitaufwändigen Problemen oder Datenverlust kommen.
Übersicht > Intrexx Professional: Programming > Swapping tables in a placeholder based on 2 dropdown menus - help with code needed

Swapping tables in a placeholder based on 2 dropdown menus - help with code needed

Hopefully I can explain this properly

I created 2 dropdowns, reports and subreports. Each report can have 0 or more subreports. The subreport dropdown is filtered to only show those subreports associated with the main report.

From these dropdowns I have created 2 filtered tables so when I select a report, only this is displayed in the Report table and in the 2nd table (subreports), only those associated with the selected Report. (when nothing is selected then both table will show all reports and subreport for their table)

What is requested is that if I select a Report, only the report Table is shown unless I select a subreport and then only the subreport table must be shown. I created a placeholder that allows me to swap the Tables based on selection and have written the following code:

function swapTables(){
var report = Browser.getValue(getElement("EF2633D318A0F095187A15BF4A7427FBCA8B9740"));
var subreport = Browser.getValue(getElement("38AA421AA0D47A7BA49ED0D066745A652C43FC2E"));
var reportTable = document.getElementById("ID_simplegroup82992EE3").innerHTML;
var subreportTable = document.getElementById("ID_simplegroup7ADF6F26").innerHTML;

if(subreport != false) {
document.getElementById("ID_simplegroup8EB52B65").innerHTML = subreportTable;
}

else if(report != false){
document.getElementById("ID_simplegroup8EB52B65").innerHTML = reportTable;
}
}



This works to some extent, it will swap the report table with the subreport table in the placeholder, if and only if I select a subreport. My problem is that if I select a wrong Report or subreport e.g. click report 1 instead of report 2 , then the tables stay on my original selection. The table filters don't work when I have this code loaded. (work fine without code but I need this to swap tables in my placeholder)

Is there a way to adjust the above code to allow me to change my selection and give me the correct table? The code is onchange for both dropdowns.

Really appreciate any help on this as I am stuck with the project and can't go any further attention
08.02.2016 09:04 von Siobhan
I wouldn't put tables dynamiclly into a group, i would rather put a group around each table and show/hide the complete group using jQuery.


$(getElement("guid")).show();
$(getElement("guid")).hide();

09.02.2016 06:57 von MartinW
I wouldn't put tables dynamiclly into a group, i would rather put a group around each table and show/hide the complete group using jQuery.


$(getElement("guid")).show();
$(getElement("guid")).hide();



that was an option for me but it created a lot of whitespace in Javascript (left too much space when one table was hidden).. will the jQuery help with that?
09.02.2016 07:06 von Siobhan
I don't know, but you can put both groups in a third group and use the third as a DIV, so all content will move to the top.
09.02.2016 07:47 von MartinW
Apologies but I don't know how to do that
09.02.2016 08:18 von Siobhan
You double-click on the group and switch to the options-tab. there you can choose between table and div.
default is table.
09.02.2016 09:46 von MartinW
Martin, thank you so much.. it is exactly what I was looking for. works like a dream
09.02.2016 10:20 von Siobhan
Zurück | Alles über Intrexx | Impressum | Datenschutzerklärung

Über United Planet
© 2019 United Planet GmbH
Schnewlinstraße 2
79098 Freiburg