IDEMPIERE-4165 Display issue in grid mode after grid toggle

This commit is contained in:
Diego Ruiz 2020-02-08 11:22:38 +01:00 committed by Carlos Ruiz
parent 3ed3ca4761
commit 63ce461862
3 changed files with 16 additions and 3 deletions

View File

@ -1500,7 +1500,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
listPanel.dynamicDisplay(col);
if (GridTable.DATA_REFRESH_MESSAGE.equals(e.getAD_Message()) ||
"Sorted".equals(e.getAD_Message())) {
Clients.resize(listPanel.getListbox());
listPanel.getListbox().invalidate();
}
}
}

View File

@ -124,6 +124,7 @@ import org.zkoss.zul.Columns;
import org.zkoss.zul.Div;
import org.zkoss.zul.Menuitem;
import org.zkoss.zul.Menupopup;
import org.zkoss.zul.RowRenderer;
import org.zkoss.zul.Window.Mode;
/**
@ -2152,8 +2153,15 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
}
}
if (dirtyTabpanel != null)
if (dirtyTabpanel != null) {
focusToTabpanel(dirtyTabpanel);
//ensure row indicator is not lost
RowRenderer<Object[]> renderer = dirtyTabpanel.getGridView().getListbox().getRowRenderer();
GridTabRowRenderer gtr = (GridTabRowRenderer)renderer;
org.zkoss.zul.Row row = gtr.getCurrentRow();
if (row != null)
gtr.setCurrentRow(row);
}
else
focusToActivePanel();

View File

@ -588,6 +588,11 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
LayoutUtils.addSclass("grid-inactive-row", row);
}
//IDEMPIERE-4165 After adding a new row to the list (New or copy) repaint the grid when rendering the last row
if (gridTab.isNew() && rowIndex == grid.getRows().getChildren().size()-1) {
grid.invalidate();
}
}
/**