IDEMPIERE-486 Display problem in grid model of Windows>Tab>Field page. Faster fix for the issue, previous fix caused significant performance issue when the number of column and row of the grid is big.
This commit is contained in:
parent
45d88ff3ab
commit
b92320fdb6
|
@ -45,7 +45,6 @@ import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zk.ui.event.Events;
|
import org.zkoss.zk.ui.event.Events;
|
||||||
import org.zkoss.zk.ui.util.Clients;
|
import org.zkoss.zk.ui.util.Clients;
|
||||||
import org.zkoss.zul.Cell;
|
import org.zkoss.zul.Cell;
|
||||||
import org.zkoss.zul.Div;
|
|
||||||
import org.zkoss.zul.Grid;
|
import org.zkoss.zul.Grid;
|
||||||
import org.zkoss.zul.Label;
|
import org.zkoss.zul.Label;
|
||||||
import org.zkoss.zul.Paging;
|
import org.zkoss.zul.Paging;
|
||||||
|
@ -252,11 +251,11 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
|
||||||
for (Entry<GridField, WEditor> entry : editors.entrySet()) {
|
for (Entry<GridField, WEditor> entry : editors.entrySet()) {
|
||||||
if (entry.getValue().getComponent().getParent() != null) {
|
if (entry.getValue().getComponent().getParent() != null) {
|
||||||
Component child = entry.getValue().getComponent();
|
Component child = entry.getValue().getComponent();
|
||||||
Div div = null;
|
Cell div = null;
|
||||||
while (div == null && child != null) {
|
while (div == null && child != null) {
|
||||||
Component parent = child.getParent();
|
Component parent = child.getParent();
|
||||||
if (parent instanceof Div && parent.getParent() instanceof Row)
|
if (parent instanceof Cell && parent.getParent() instanceof Row)
|
||||||
div = (Div)parent;
|
div = (Cell)parent;
|
||||||
else
|
else
|
||||||
child = parent;
|
child = parent;
|
||||||
}
|
}
|
||||||
|
@ -383,7 +382,7 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
|
||||||
}
|
}
|
||||||
colIndex ++;
|
colIndex ++;
|
||||||
|
|
||||||
Div div = new Div();
|
Cell div = new Cell();
|
||||||
String divStyle = CELL_DIV_STYLE;
|
String divStyle = CELL_DIV_STYLE;
|
||||||
org.zkoss.zul.Column column = (org.zkoss.zul.Column) columns.getChildren().get(colIndex);
|
org.zkoss.zul.Column column = (org.zkoss.zul.Column) columns.getChildren().get(colIndex);
|
||||||
if (column.isVisible()) {
|
if (column.isVisible()) {
|
||||||
|
@ -399,8 +398,7 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
div.setStyle(divStyle);
|
div.setStyle(divStyle);
|
||||||
div.setWidth(column.getWidth());
|
div.setWidth("100%");
|
||||||
div.setHflex("1");
|
|
||||||
div.setAttribute("columnName", gridPanelFields[i].getColumnName());
|
div.setAttribute("columnName", gridPanelFields[i].getColumnName());
|
||||||
div.addEventListener(Events.ON_CLICK, rowListener);
|
div.addEventListener(Events.ON_CLICK, rowListener);
|
||||||
div.addEventListener(Events.ON_DOUBLE_CLICK, rowListener);
|
div.addEventListener(Events.ON_DOUBLE_CLICK, rowListener);
|
||||||
|
@ -483,7 +481,7 @@ public class GridTabRowRenderer implements RowRenderer<Object[]>, RowRendererExt
|
||||||
|
|
||||||
org.zkoss.zul.Column column = (org.zkoss.zul.Column) columns.getChildren().get(colIndex);
|
org.zkoss.zul.Column column = (org.zkoss.zul.Column) columns.getChildren().get(colIndex);
|
||||||
if (column.isVisible()) {
|
if (column.isVisible()) {
|
||||||
Div div = (Div) currentRow.getChildren().get(colIndex);
|
Cell div = (Cell) currentRow.getChildren().get(colIndex);
|
||||||
div.getChildren().clear();
|
div.getChildren().clear();
|
||||||
WEditor editor = getEditorCell(gridPanelFields[i]);
|
WEditor editor = getEditorCell(gridPanelFields[i]);
|
||||||
div.appendChild(editor.getComponent());
|
div.appendChild(editor.getComponent());
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.beans.PropertyChangeListener;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.adempiere.webui.AdempiereWebUI;
|
import org.adempiere.webui.AdempiereWebUI;
|
||||||
|
import org.adempiere.webui.LayoutUtils;
|
||||||
import org.adempiere.webui.component.Bandbox;
|
import org.adempiere.webui.component.Bandbox;
|
||||||
import org.adempiere.webui.component.Button;
|
import org.adempiere.webui.component.Button;
|
||||||
import org.adempiere.webui.component.Datebox;
|
import org.adempiere.webui.component.Datebox;
|
||||||
|
@ -42,6 +43,7 @@ import org.zkoss.zk.ui.HtmlBasedComponent;
|
||||||
import org.zkoss.zk.ui.event.Event;
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zk.ui.event.EventListener;
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
import org.zkoss.zk.ui.event.Events;
|
import org.zkoss.zk.ui.event.Events;
|
||||||
|
import org.zkoss.zul.Combobox;
|
||||||
import org.zkoss.zul.Image;
|
import org.zkoss.zul.Image;
|
||||||
import org.zkoss.zul.Menuitem;
|
import org.zkoss.zul.Menuitem;
|
||||||
import org.zkoss.zul.Textbox;
|
import org.zkoss.zul.Textbox;
|
||||||
|
@ -489,7 +491,7 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
|
||||||
//can't stretch bandbox & datebox
|
//can't stretch bandbox & datebox
|
||||||
if (!(getComponent() instanceof Bandbox) &&
|
if (!(getComponent() instanceof Bandbox) &&
|
||||||
!(getComponent() instanceof Datebox)) {
|
!(getComponent() instanceof Datebox)) {
|
||||||
String width = tableEditor ? "98%" : "100%";
|
String width = tableEditor ? "96%" : "100%";
|
||||||
if (getComponent() instanceof Button) {
|
if (getComponent() instanceof Button) {
|
||||||
if (!tableEditor) {
|
if (!tableEditor) {
|
||||||
Button btn = (Button) getComponent();
|
Button btn = (Button) getComponent();
|
||||||
|
@ -507,10 +509,19 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
|
||||||
image.setWidth("24px");
|
image.setWidth("24px");
|
||||||
image.setHeight("24px");
|
image.setHeight("24px");
|
||||||
} else {
|
} else {
|
||||||
if (getComponent() instanceof InputElement) {
|
if (!tableEditor) {
|
||||||
((InputElement)getComponent()).setHflex("1");
|
if (getComponent() instanceof InputElement) {
|
||||||
|
((InputElement)getComponent()).setHflex("1");
|
||||||
|
} else {
|
||||||
|
((HtmlBasedComponent)getComponent()).setWidth(width);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
((HtmlBasedComponent)getComponent()).setWidth(width);
|
if (getComponent() instanceof Combobox) {
|
||||||
|
LayoutUtils.addSclass("grid-combobox-editor", (HtmlBasedComponent)getComponent());
|
||||||
|
} else {
|
||||||
|
((HtmlBasedComponent)getComponent()).setWidth(width);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getComponent() instanceof Textbox && tableEditor) {
|
if (getComponent() instanceof Textbox && tableEditor) {
|
||||||
|
|
|
@ -997,4 +997,12 @@ tbody.z-grid-empty-body td {
|
||||||
border-left: 5px dashed #696969;
|
border-left: 5px dashed #696969;
|
||||||
border-right: 5px dashed transparent;
|
border-right: 5px dashed transparent;
|
||||||
border-bottom: 5px solid transparent;
|
border-bottom: 5px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-combobox-editor {
|
||||||
|
width: 96% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-combobox-editor input {
|
||||||
|
width: 85% !important;
|
||||||
}
|
}
|
Loading…
Reference in New Issue