IDEMPIERE-1871 1003779 Inactive records should be distinguishable from Active records in grid view.

This commit is contained in:
Heng Sin Low 2014-03-27 22:50:00 +08:00
parent ee3e5644ca
commit 8d6a31defd
2 changed files with 31 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import java.util.Map.Entry;
import java.util.Properties;
import org.adempiere.util.GridRowCtx;
import org.adempiere.webui.LayoutUtils;
import org.adempiere.webui.component.Button;
import org.adempiere.webui.component.Checkbox;
import org.adempiere.webui.component.EditorBox;
@ -361,7 +362,7 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
Grid grid = (Grid) row.getParent().getParent();
org.zkoss.zul.Columns columns = grid.getColumns();
int rowIndex = row.getParent().getChildren().indexOf(row);
int rowIndex = index;
if (paging != null && paging.getPageSize() > 0) {
rowIndex = (paging.getActivePage() * paging.getPageSize()) + rowIndex;
}
@ -391,6 +392,7 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
row.appendChild(cell);
Boolean isActive = null;
int colIndex = -1;
for (int i = 0; i < columnCount; i++) {
if (editors.get(gridPanelFields[i]) == null) {
@ -416,6 +418,15 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
defaultFocusField = editor;
}
if ("IsActive".equals(gridPanelFields[i].getColumnName())) {
isActive = Boolean.FALSE;
if (currentValues[i] != null) {
if ("true".equalsIgnoreCase(currentValues[i].toString())) {
isActive = Boolean.TRUE;
}
}
}
if (!gridPanelFields[i].isDisplayedGrid() || gridPanelFields[i].isToolbarButton()) {
continue;
}
@ -453,6 +464,20 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
row.setStyle("cursor:pointer");
row.addEventListener(Events.ON_CLICK, rowListener);
row.addEventListener(Events.ON_OK, rowListener);
if (isActive == null) {
Object isActiveValue = gridTab.getValue(rowIndex, "IsActive");
if (isActiveValue != null) {
if ("true".equalsIgnoreCase(isActiveValue.toString())) {
isActive = Boolean.TRUE;
} else {
isActive = Boolean.FALSE;
}
}
}
if (isActive != null && !isActive.booleanValue()) {
LayoutUtils.addSclass("grid-inactive-row", row);
}
}
/**

View File

@ -922,6 +922,11 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
left: 4px;
z-index: -1;
}
.z-grid tbody tr.grid-inactive-row td.z-cell {
background-image: none !important;
background-color: #DCDAD4 !important;
}
.z-grid tbody tr.highlight td.z-cell {
background-color: #FFFFCC !important;