IDEMPIERE-6119 Show dashboard content layout on column when open on mobile screen size (#2350)

This commit is contained in:
hengsin 2024-05-07 11:05:26 +08:00 committed by Carlos Ruiz
parent 47f1336df4
commit 6cb5788651
1 changed files with 5 additions and 6 deletions

View File

@ -543,7 +543,7 @@ public class DashboardController implements EventListener<Event> {
// Dashboard content // Dashboard content
Hlayout dashboardLineLayout = null; Hlayout dashboardLineLayout = null;
int currentLineNo = 0; int currentLineNo = 0;
int noOfLines = 0; int maxPerLine = 0;
int width = 100; int width = 100;
try try
{ {
@ -562,13 +562,12 @@ public class DashboardController implements EventListener<Event> {
} }
} }
noOfLines = MDashboardPreference.getForSessionRowCount(isShowInDashboard, AD_User_ID, AD_Role_ID);
if (ClientInfo.isMobile() && isShowInDashboard) { if (ClientInfo.isMobile() && isShowInDashboard) {
if (ClientInfo.maxWidth(ClientInfo.MEDIUM_WIDTH-1)) { if (ClientInfo.maxWidth(ClientInfo.MEDIUM_WIDTH-1)) {
if (ClientInfo.maxWidth(ClientInfo.SMALL_WIDTH-1)) { if (ClientInfo.maxWidth(ClientInfo.SMALL_WIDTH-1)) {
noOfLines = 1; maxPerLine = 1;
} else if (noOfLines > 2) { } else {
noOfLines = 2; maxPerLine = 2;
} }
} }
} }
@ -586,7 +585,7 @@ public class DashboardController implements EventListener<Event> {
int lineNo = dp.getLine().intValue(); int lineNo = dp.getLine().intValue();
int flexGrow = (flexGrow = dp.getFlexGrow()) > 0 ? flexGrow : DEFAULT_FLEX_GROW; int flexGrow = (flexGrow = dp.getFlexGrow()) > 0 ? flexGrow : DEFAULT_FLEX_GROW;
if(dashboardLineLayout == null || currentLineNo != lineNo) if(dashboardLineLayout == null || currentLineNo != lineNo || (maxPerLine > 0 && dashboardLineLayout.getChildren().size() == maxPerLine))
{ {
dashboardLineLayout = new Hlayout(); dashboardLineLayout = new Hlayout();
dashboardLineLayout.setAttribute(LINE_ATTRIBUTE, lineNo); dashboardLineLayout.setAttribute(LINE_ATTRIBUTE, lineNo);