Exemplo n.º 1
0
  @Override
  protected int adjustWidthAnchor(int width, Component comp) {
    if (comp instanceof Field<?>) {
      Field<?> f = (Field<?>) comp;
      width -= (f.isHideLabel() ? 0 : labelAdjust);

      // offset due to the label element
      if (((GXT.isIE && !GXT.isStrict) || GXT.isIE6)
          && !labelAlign.equals(LabelAlign.TOP)
          && !f.isHideLabel()) {
        width -= 3;
      }
    }

    return super.adjustWidthAnchor(width, comp);
  }
Exemplo n.º 2
0
  protected void renderField(Field<?> field, int index, El target) {
    String ls = field.getLabelSeparator() != null ? field.getLabelSeparator() : labelSeparator;
    field.setLabelSeparator(ls);
    Params p = new Params();
    if (hideLabels) {
      field.setHideLabel(true);
    }

    p.add(field.getId());
    p.add(field.getFieldLabel());
    p.add(labelStyle);
    p.add(elementStyle);
    p.add(ls);
    p.add(field.isHideLabel() ? "x-hide-label" : "");
    p.add("x-form-clear-left");
    p.add(field.getLabelStyle());

    String inputId = field.getId();
    p.add(inputId);

    fieldTemplate.insert(target.dom, index, p);
    if (field.isRendered()) {
      target.selectNode(".x-form-el-" + field.getId()).appendChild(field.getElement());
    } else {
      field.render(target.selectNode(".x-form-el-" + field.getId()).dom);
    }

    if (field.getStyleName().contains("-wrap")) {
      inputId += "-input";
      target
          .selectNode(".x-form-el-" + field.getId())
          .previousSibling()
          .setAttribute("for", inputId);
    }
  }
Exemplo n.º 3
0
 @Override
 protected int adjustHeightAnchor(int height, Component comp) {
   if (comp instanceof Field<?>) {
     Field<?> f = (Field<?>) comp;
     if (!f.isHideLabel() && labelAlign.equals(LabelAlign.TOP)) {
       El elem = findLabelElement(comp);
       if (elem != null) {
         height -= elem.getHeight();
       }
     }
   }
   return super.adjustHeightAnchor(height, comp);
 }