Package com.extjs.gxt.ui.client.js

Examples of com.extjs.gxt.ui.client.js.JsArray


      jsArray.add(value);
    }
  }

  private static JsArray processMap(Map<?, ?> map, int maxDepth) {
    JsArray jsArray = new JsArray();
    if (maxDepth > 0) {
      for (Entry<?, ?> o : map.entrySet()) {
        JsObject jsObj = new JsObject();
        internalProcessObject(jsObj, maxDepth, o.getKey(), "key");
        internalProcessObject(jsObj, maxDepth, o.getValue(), "value");
        jsArray.add(jsObj.getJsObject());
      }
    }
    return jsArray;
  }
View Full Code Here


  /**
   * Iterates down into Object[], producing the required JsArray
   */
  private static JsArray processArray(Object[] c, int maxDepth) {
    JsArray jsArray = new JsArray();
    if (maxDepth > 0) {
      for (Object obj : c) {
        internalProcessArray(jsArray, maxDepth, obj);
      }
    }
View Full Code Here

   * @param models the list of models
   * @param maxDepth the maximum number of sub models to process
   * @return the javascript array object
   */
  public static JavaScriptObject getJsObjects(List<? extends ModelData> models, int maxDepth) {
    JsArray js = new JsArray();
    for (ModelData m : models) {
      js.add(getJsObject(m, maxDepth));
    }
    return js.getJsObject();
  }
View Full Code Here

   * Returns the group elements.
   */
  @SuppressWarnings({"unchecked", "rawtypes"})
  public NodeList<Element> getGroups() {
    if (!enableGrouping) {
      return new JsArray().getJsObject().cast();
    }
    return (NodeList) mainBody.dom.getChildNodes();
  }
View Full Code Here

  protected NodeList<Element> getRows() {
    if (!enableGrouping) {
      return super.getRows();
    }
    if (!hasRows()) {
      return new JsArray().getJsObject().cast();
    }

    NodeList<Element> gs = getGroups();
    JsArray rows = new JsArray();
    for (int i = 0, len = gs.getLength(); i < len; i++) {
      NodeList<Element> g = gs.getItem(i).getChildNodes().getItem(1).getChildNodes().cast();
      for (int j = 0, len2 = g.getLength(); j < len2; j++) {
        rows.add(g.getItem(j));
      }
    }
    return rows.getJsObject().cast();
  }
View Full Code Here

    return Util.isEmptyString(text) ? "&#160;" : text;
  }

  protected NodeList<Element> getRows() {
    if (!hasRows()) {
      return new JsArray().getJsObject().cast();
    }
    return mainBody.dom.getChildNodes().cast();
  }
View Full Code Here

   * Returns the group elements.
   */
  @SuppressWarnings({"unchecked", "rawtypes"})
  public NodeList<Element> getGroups() {
    if (!enableGrouping) {
      return new JsArray().getJsObject().cast();
    }
    return (NodeList) mainBody.dom.getChildNodes();
  }
View Full Code Here

  protected NodeList<Element> getRows() {
    if (!enableGrouping) {
      return super.getRows();
    }
    if (!hasRows()) {
      return new JsArray().getJsObject().cast();
    }

    NodeList<Element> gs = getGroups();
    JsArray rows = new JsArray();
    for (int i = 0, len = gs.getLength(); i < len; i++) {
      NodeList<Element> g = gs.getItem(i).getChildNodes().getItem(1).getChildNodes().cast();
      for (int j = 0, len2 = g.getLength(); j < len2; j++) {
        rows.add(g.getItem(j));
      }
    }
    return rows.getJsObject().cast();
  }
View Full Code Here

   * @param models the list of models
   * @param maxDepth the maximum number of sub models to process
   * @return the javascript array object
   */
  public static JavaScriptObject getJsObjects(List<? extends ModelData> models, int maxDepth) {
    JsArray js = new JsArray();
    for (ModelData m : models) {
      js.add(getJsObject(m, maxDepth));
    }
    return js.getJsObject();
  }
View Full Code Here

  /**
   * Iterates down into Object[], producing the required JsArray
   */
  private static JsArray processArray(Object[] c, int maxDepth) {
    JsArray jsArray = new JsArray();
    if (maxDepth > 0) {
      for (Object obj : c) {
        internalProcessArray(jsArray, maxDepth, obj);
      }
    }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.js.JsArray

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.