Use simpler means to highlight current row of grid.

Fixed sizing of editor component sometimes not correct using inplace edit.
This commit is contained in:
Heng Sin Low 2012-03-02 15:16:38 +08:00
parent 6b4c3884ec
commit a4527128a9
1 changed files with 3 additions and 2 deletions

View File

@ -68,7 +68,7 @@ import org.zkoss.zhtml.Text;
*/ */
public class GridTabRowRenderer implements RowRenderer, RowRendererExt, RendererCtrl { public class GridTabRowRenderer implements RowRenderer, RowRendererExt, RendererCtrl {
private static final String CURRENT_ROW_STYLE = "border-top: 2px solid #6f97d2; border-bottom: 2px solid #6f97d2"; private static final String CURRENT_ROW_STYLE = "background-color: #BDEDFF";
private static final int MAX_TEXT_LENGTH = 60; private static final int MAX_TEXT_LENGTH = 60;
private GridTab gridTab; private GridTab gridTab;
private int windowNo; private int windowNo;
@ -478,6 +478,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt, Renderer
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); Div div = (Div) currentRow.getChildren().get(colIndex);
div.getFirstChild().setVisible(false);
WEditor editor = getEditorCell(gridField[i], currentValues[i], i); WEditor editor = getEditorCell(gridField[i], currentValues[i], i);
div.appendChild(editor.getComponent()); div.appendChild(editor.getComponent());
WEditorPopupMenu popupMenu = editor.getPopupMenu(); WEditorPopupMenu popupMenu = editor.getPopupMenu();
@ -487,7 +488,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt, Renderer
popupMenu.addMenuListener((ContextMenuListener)editor); popupMenu.addMenuListener((ContextMenuListener)editor);
div.appendChild(popupMenu); div.appendChild(popupMenu);
} }
div.getFirstChild().setVisible(false);
//check context //check context
if (!gridField[i].isDisplayed(true)) if (!gridField[i].isDisplayed(true))
{ {