Package com.extjs.gxt.ui.client.util

Examples of com.extjs.gxt.ui.client.util.Params


  }

  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 {
View Full Code Here


    StringBuilder buf = new StringBuilder();
    int last = cs.size() - 1;
    for (int i = 0, len = cs.size(); i < len; i++) {
      ColumnData c = cs.get(i);
      SummaryColumnConfig cf = (SummaryColumnConfig) cm.getColumn(i);
      Params p = new Params();
      p.set("id", c.id);
      p.set("style", c.style);
      String css = i == 0 ? "x-grid3-cell-first " : (i == last ? "x-grid3-cell-last " : "");
      p.set("css", css);
      if (cf.getSummaryFormat() != null) {
        p.set("value", cf.getSummaryFormat().format(((Number) data.get(c.name)).doubleValue()));
      } else if (cf.getSummaryRenderer() != null) {
        p.set("value", cf.getSummaryRenderer().render(data.get(c.name), data));
      } else {
        p.set("value", data.get(c.name));
      }
      buf.append(cellTpl.applyTemplate(p));

    }
    Params rp = new Params();
    rp.set("tstyle", "width:" + getTotalWidth() + "px;");
    rp.set("cells", buf.toString());

    return rowTpl.applyTemplate(rp);
  }
View Full Code Here

    el().addEventsSunk(Event.ONCLICK | Event.ONDBLCLICK | Event.KEYEVENTS | Event.MOUSEEVENTS);
  }

  protected void onRenderItem(DataListItem item, Element target, int index) {
    Params p = new Params();
    p.set("style", itemStyle);
    p.set("iconStyle", item.getIconStyle());
    p.set("icon", item.getIconStyle() != null ? "" : "display: none");
    p.set("text", item.getText());
    p.set("id", item.getId());
    item.setElement(itemTemplate.create(p), target, index);

    if (!GXT.isIE) {
      item.el().setTabIndex(0);
    }
View Full Code Here

    StringBuilder buf = new StringBuilder();
    int last = cs.size() - 1;
    for (int i = 0, len = cs.size(); i < len; i++) {
      ColumnData c = cs.get(i);
      SummaryColumnConfig cf = (SummaryColumnConfig) cm.getColumn(i);
      Params p = new Params();
      p.set("id", c.id);
      p.set("style", c.style);
      String css = i == 0 ? "x-grid3-cell-first " : (i == last ? "x-grid3-cell-last " : "");
      p.set("css", css);
      if (cf.getSummaryFormat() != null) {
        p.set("value", cf.getSummaryFormat().format(data.get(c.name)));
      } else if (cf.getSummaryRenderer() != null) {
        p.set("value", cf.getSummaryRenderer().render(data.get(c.name), data));
      } else {
        p.set("value", data.get(c.name));
      }
      buf.append(cellTpl.applyTemplate(p));

    }
    Params rp = new Params();
    rp.set("tstyle", "width:" + getTotalWidth() + ";");
    rp.set("cells", buf.toString());

    return rowTpl.applyTemplate(rp);
  }
View Full Code Here

      style += " x-item-disabled";
    }
    if (item.getIconStyle() != null) {
      style += " x-tab-with-icon";
    }
    Params p = new Params();
    p.set("id", item.getId());
    p.set("text", item.getText());
    p.set("style", style);
    p.set("textStyle", item.getTextStyle());
    p.set("iconStyle", item.getIconStyle());
    if (item.template == null) {
      item.template = itemTemplate;
    }
    item.header.setElement(item.template.create(p));
    item.header.el().addEventsSunk(Event.ONCLICK | Event.MOUSEEVENTS);
View Full Code Here

  public void setTemplate(Template template) {
    this.template = template;
  }

  protected String bulkRenderItem(DataViewItem item) {
    return template.applyTemplate(new Params(item.getValues()));
  }
View Full Code Here

      item.setElement(elems[i]);
    }
  }

  protected void renderItem(DataViewItem item, int index) {
    item.setElement(XDOM.create(template.applyTemplate(new Params(item.getValues()))));
    el().insertChild(item.getElement(), index);
  }
View Full Code Here

   * @param title the message title
   * @param text the message
   * @param values the values to be substituted
   */
  public static void display(String title, String text, String... values) {
    display(new InfoConfig(title, text, new Params((Object[]) values)));
  }
View Full Code Here

      String k = keys.next();
      Object v = params.get(k);
      if (v instanceof Params) {
        v = ((Params) v).getValues();
      } else if (v instanceof ModelData) {
        v = new Params(((ModelData) v).getProperties()).getValues();
      }
      obj.set(k, v);
    }
    return obj.getJsObject();
  }
View Full Code Here

    el().addEventsSunk(Event.ONCLICK | Event.ONDBLCLICK | Event.KEYEVENTS | Event.MOUSEEVENTS);
  }

  protected void onRenderItem(DataListItem item, Element target, int index) {
    Params p = new Params();
    p.set("style", itemStyle);
    p.set("iconStyle", item.getIconStyle());
    p.set("textStyle", item.getTextStyle() != null ? item.getTextStyle() : "");
    p.set("icon", item.getIconStyle() != null ? "" : "display: none");
    p.set("text", item.getText());
    p.set("id", item.getId());
    item.setElement(itemTemplate.create(p), target, index);

    if (!GXT.isIE) {
      item.el().setTabIndex(0);
    }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.util.Params

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.