Examples of JsArray


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

    }
    return jsArray;
  }

  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

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

   * 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

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

  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

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

    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

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

    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

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

  /**
   * Iterates down into Collection, producing the required JsArray
   */
  @SuppressWarnings("rawtypes")
  private static JsArray processCollection(Collection c, int maxDepth) {
    JsArray jsArray = new JsArray();
    if (maxDepth > 0) {
      for (Object obj : c) {
        if (obj instanceof ModelData) {
          jsArray.add(getJsObject((ModelData) obj, maxDepth - 1));
        } else if (obj instanceof Collection) {
          jsArray.add(processCollection((Collection) obj, maxDepth - 1).getJsObject());
        } else {
          jsArray.add(obj);
        }
      }
    }
    return jsArray;
  }
View Full Code Here

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

  /**
   * 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) {
        if (obj instanceof ModelData) {
          jsArray.add(getJsObject((ModelData) obj, maxDepth - 1));
        } else if (obj instanceof Object[]) {
          jsArray.add(processArray((Object[]) obj, maxDepth - 1).getJsObject());
        } else {
          jsArray.add(obj);
        }
      }
    }
    return jsArray;
  }
View Full Code Here

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

   * @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

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

  protected void updateAllColumnWidths() {
    String tw = getTotalWidth();
    int clen = cm.getColumnCount();
    Stack<String> ws = new Stack<String>();
    JsArray jsws = new JsArray();

    for (int i = 0; i < clen; i++) {
      ws.push(getColumnWidth(i));
      jsws.add(getColumnWidth(i));
    }

    innerHd.firstChild().firstChild().setWidth(tw);

    for (int i = 0; i < clen; i++) {
      Element hd = getHeaderCell(i);
      hd.getStyle().setProperty("width", ws.get(i));
    }
    JavaScriptObject rows = getRowsNative(mainBody.dom);
    updateAllColumnWidthsNative(rows, clen, tw, jsws.getJsObject());
    updateInnerHeaders();
    templateOnAllColumnWidthsUpdated(ws, tw);
  }
View Full Code Here

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

    for (String key : model.getPropertyNames()) {
      Object value = model.get(key);
      if (value == null) continue;
      if (maxDepth > 0) {
        if (value instanceof Collection) {
          JsArray jsArray = new JsArray();
          Collection c = (Collection) value;
          for (Object obj : c) {
            if (obj instanceof ModelData) {
              jsArray.add(getJsObject((ModelData) obj, maxDepth - 1));
            }
          }
          jsObj.set(key, jsArray);
        } else if (value instanceof Object[]) {
          JsArray jsArray = new JsArray();
          Object[] c = (Object[]) value;
          for (Object obj : c) {
            if (obj instanceof ModelData) {
              jsArray.add(getJsObject((ModelData) obj, maxDepth - 1));
            }
          }
          jsObj.set(key, jsArray);
        } else if (value instanceof ModelData) {
          jsObj.set(key, getJsObject((ModelData) value, maxDepth - 1));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.