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

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


      {
       public String render(Buddy model, String property,
          ColumnData config, int rowIndex, int colIndex,
          ListStore<Buddy> store)
      {
        Params p = new Params();
          p.add("<img src=\"images/icons/fam/user.gif\" />");
          return Format.substitute("{0}", p);
      }

      });
    column.setFixed(true);
    columnConfigs.add(column);
   
    column = new ColumnConfig("nick","Nick",32)
    column.setRenderer(new GridCellRenderer<Buddy>()
      {
      public String render(Buddy model, String property,
          ColumnData config, int rowIndex, int colIndex,
          ListStore<Buddy> store)
      {
        Params p = new Params();
          p.add(model.get("nick"));
          return Format.substitute("<span style=\"vertical-align: middle;color:black;\">{0}</span>",
              p);
      }

      });
View Full Code Here


      {
      public String render(ContactData model, String property,
          ColumnData config, int rowIndex, int colIndex,
          ListStore<ContactData> store)
      {
        Params p = new Params();
          String img = model.get(IMG);
          p.add(img);
          return Format.substitute("<img src=\"{0}\" style=\"width=32px;height:32px;cursor: pointer;\" />",p);
      }

      });
      avatarColumnConfig.setFixed(true);

       
      ColumnConfig statusImgColumnConfig = new ColumnConfig(STATUSIMG,"Status", 20);
      statusImgColumnConfig.setRenderer(new GridCellRenderer<ContactData>()
      {
      public String render(ContactData model, String property,
          ColumnData config, int rowIndex, int colIndex,
          ListStore<ContactData> store)
      {
        Params p = new Params();
          p.add(model.get(STATUSIMG));
          return Format.substitute("{0}", p);
      }

      });
      statusImgColumnConfig.setFixed(true);

      ColumnConfig groupColumnConfig = new ColumnConfig(USER_GROUP_DD,"Group", 0);
      groupColumnConfig.setHidden(true);  

      ColumnConfig aliasColumnConfig = new ColumnConfig(ALIAS,"Alias",32);
      aliasColumnConfig.setRenderer(new GridCellRenderer<ContactData>()
      {
      public String render(ContactData model, String property,
          ColumnData config, int rowIndex, int colIndex,
          ListStore<ContactData> store)
      {
        Params p = new Params();
          p.add(model.get(ALIAS));
          p.add(model.get(STATUSTEXT));
          return Format.substitute("<span style=\"vertical-align: middle;color:black;\">{0}</span><br/><span style=\"vertical-align: middle;color:gray;\">{1}</span>",
              p);
      }

      });
View Full Code Here

    getHeader().setText(title);
    // show header or not
    getHeader().el().selectNode("#" + getHeader().getId() + "-label").setVisible(title != null && !"".equals(title));

    if (toolTipConfig.getTemplate() != null) {
      Params p = toolTipConfig.getParams();
      if (p == null) p = new Params();
      p.set("text", text);
      p.set("title", title);
      toolTipConfig.getTemplate().overwrite(getBody().dom, p);
    } else {
      getBody().update(Util.isEmptyString(text) ? "&#160;" : text);
    }
  }
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

    sb.append("<div class='{cls}-wrap'><div class='{cls}-inner'><div class='{cls}-bar'>");
    sb.append("<div class='{cls}-text'><div>&#160;</div></div></div>");
    sb.append("<div class='{cls}-text {cls}-text-back'><div>&#160;</div></div></div></div>");

    Template t = new Template(sb.toString());
    setElement(t.create(new Params("cls", baseStyle)), target, index);

    El inner = el().firstChild();
    progressBar = inner.firstChild();
    textTopElem = progressBar.firstChild();
    textBackElem = inner.childNode(1);
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

   *
   * @param values the substitution values
   * @return the new element
   */
  public Element create(Object... values) {
    return create(new Params(values));
  }
View Full Code Here

   * @param el the context element
   * @param values the values
   * @return the new element
   */
  public Element overwrite(Element el, Params values) {
    if (values == null) values = new Params();
    return insertInternal("overwrite", t, el, values.getValues());
  }
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

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

  protected String bulkRenderItem(DataViewItem item) {
    return template.applyTemplate(new Params(item.getValues()));
  }
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.