Package com.extjs.gxt.ui.client.store

Examples of com.extjs.gxt.ui.client.store.Record


      showTooltip(getMessages().getDirtyText());
      return;
    }
    hideTooltip();
    M model = (M) grid.getStore().getAt(rowIndex);
    Record r = getRecord(model);
    RowEditorEvent ree = new RowEditorEvent(this, rowIndex);
    ree.setRecord(r);

    Element row = (Element) grid.getView().getRow(rowIndex);
View Full Code Here


  protected void onMouseDown(GridEvent<ModelData> ge) {
    El el = ge.getTargetEl();
    if (el != null && el.hasStyleName("x-grid3-cc-" + getId()) && !el.hasStyleName("x-grid3-check-col-disabled")) {
      ge.stopEvent();
      ModelData m = ge.getModel();
      Record r = grid.getView().ds.getRecord(m);
      Boolean b = (Boolean) m.get(getDataIndex());
      r.set(getDataIndex(), b == null ? true : !b);
    }
  }
View Full Code Here

   * Updates the model's value with the field value.
   */
  public void updateModel() {
    Object val = onConvertFieldValue(field.getValue());
    if (store != null) {
      Record r = store.getRecord(model);
      if (r != null) {
        r.setValid(property, field.isValid());
        r.set(property, val);
      }
    } else {
      model.set(property, val);
    }

View Full Code Here

    for (int j = 0, len = rows.size(); j < len; j++) {
      ModelData model = (ModelData) rows.get(j);

      model = prepareData(model);

      Record r = ds.hasRecord(model) ? ds.getRecord(model) : null;
      int rowIndex = (j + startRow);
      boolean visible = rowIndex >= vr[0] && rowIndex <= vr[1];
      if (!onlyBody) {
        widgetList.add(rowIndex, new ArrayList<Widget>());
      }
      if (visible) {
        for (int i = 0; i < colCount; i++) {
          ColumnData c = cs.get(i);
          c.css = c.css == null ? "" : c.css;
          String rv = getRenderedValue(c, rowIndex, i, model, c.name);

          String css = (i == 0 ? "x-grid-cell-first " : (i == last ? "x-grid3-cell-last " : " ")) + " "
              + (c.css == null ? "" : c.css);
          String attr = c.cellAttr != null ? c.cellAttr : "";
          String cellAttr = c.cellAttr != null ? c.cellAttr : "";

          if (isShowInvalidCells() && r != null && !r.isValid(c.id)) {
            buf.append(" x-grid3-invalid-cell");
          }
          if (isShowDirtyCells() && r != null && r.getChanges().containsKey(c.id)) {
            css += " x-grid3-dirty-cell";
          }

          cb.append("<td id=\"" + XDOM.getUniqueId()
              + "\" role=\"gridcell\" class=\"x-grid3-col x-grid3-cell x-grid3-td-");
          cb.append(c.id);
          cb.append(" ");
          cb.append(css);
          cb.append("\" style=\"");
          cb.append(c.style);
          cb.append("\" ");
          cb.append(cellAttr);
          cb.append("><div unselectable=\"on\" class=\"x-grid3-cell-inner x-grid3-col-");
          cb.append(c.id);
          cb.append("\" ");
          cb.append(attr);
          cb.append(">");
          cb.append(rv);
          cb.append("</div></td>");

        }
      }
      String alt = "";
      if (stripe && ((rowIndex + 1) % 2 == 0)) {
        alt += " x-grid3-row-alt";
      }

      if (isShowDirtyCells() && r != null && r.isDirty()) {
        alt += " x-grid3-dirty-row";
      }

      if (!selectable) {
        alt += " x-unselectable-single";
View Full Code Here

    editing = false;
    activeEditor = null;
    ed.removeListener(Events.SpecialKey, editorListener);
    ed.removeListener(Events.Complete, editorListener);
    ed.removeListener(Events.CancelEdit, editorListener);
    Record r = activeRecord;
    activeRecord = null;

    String field = cm.getDataIndex(ed.col);
    GridEvent<M> ge = new GridEvent<M>(grid);
    ge.setRecord(r);
    ge.setProperty(field);
    ge.setValue(value);
    ge.setStartValue(startValue);
    ge.setRowIndex(ed.row);
    ge.setColIndex(ed.col);

    if (grid.fireEvent(Events.ValidateEdit, ge)) {
      r.setValid(ge.getProperty(), ed.getField().isValid(true));
      r.set(ge.getProperty(), ge.getValue());
      grid.fireEvent(Events.AfterEdit, ge);
    }

    grid.getView().focusCell(ed.row, ed.col, false);
  }
View Full Code Here

    for (int j = 0; j < rows.size(); j++) {
      ModelData model = (ModelData) rows.get(j);

      model = prepareData(model);

      Record r = ds.hasRecord(model) ? ds.getRecord(model) : null;

      int rowBodyColSpanCount = colCount;
      if (enableRowBody) {
        if (grid.getSelectionModel() instanceof CheckBoxSelectionModel<?>) {
          CheckBoxSelectionModel<?> sm = (CheckBoxSelectionModel<?>) grid.getSelectionModel();
          if (cm.getColumnById(sm.getColumn().getId()) != null) {
            rowBodyColSpanCount--;
          }
        }
        for (ColumnConfig c : cm.getColumns()) {
          if (c instanceof RowExpander || c instanceof RowNumberer) {
            rowBodyColSpanCount--;
          }
        }
      }
      int rowIndex = (j + startRow);

      if (GXT.isAriaEnabled()) {
        buf.append("<div role=\"row\" aria-level=\"2\" class=\"x-grid3-row ");
      } else {
        buf.append("<div class=\"x-grid3-row ");
      }

      if (stripe && ((rowIndex + 1) % 2 == 0)) {
        buf.append(" x-grid3-row-alt");
      }
      if (!selectable) {
        buf.append(" x-unselectable-single");
      }

      if (showDirtyCells && r != null && r.isDirty()) {
        buf.append(" x-grid3-dirty-row");
      }
      if (viewConfig != null) {
        buf.append(" ");
        buf.append(viewConfig.getRowStyle(model, rowIndex, ds));
      }
      buf.append("\" style=\"");
      buf.append(tstyle);
      buf.append("\" id=\"");
      buf.append(grid.getId());
      buf.append("_");
      buf.append(ds.getKeyProvider() != null ? ds.getKeyProvider().getKey(model) : XDOM.getUniqueId());
      buf.append("\"><table class=x-grid3-row-table role=presentation border=0 cellspacing=0 cellpadding=0 style=\"");

      buf.append(tstyle);
      buf.append("\"><tbody role=presentation><tr role=presentation>");
      widgetList.add(rowIndex, new ArrayList<Widget>());
      for (int i = 0; i < colCount; i++) {
        ColumnData c = cs.get(i);
        c.css = c.css == null ? "" : c.css;
        String rv = getRenderedValue(c, rowIndex, i, model, c.name);
        String role = "gridcell";
        if (GXT.isAriaEnabled()) {
          ColumnConfig cc = cm.getColumn(i);
          if (cc.isRowHeader()) {
            role = "rowheader";
          }
        }

        String attr = c.cellAttr != null ? c.cellAttr : "";
        String cellAttr = c.cellAttr != null ? c.cellAttr : "";

        buf.append("<td id=\"" + XDOM.getUniqueId() + "\" role=\"" + role
            + "\" class=\"x-grid3-col x-grid3-cell x-grid3-td-");
        buf.append(c.id);
        buf.append(" ");
        buf.append(i == 0 ? "x-grid-cell-first " : (i == last ? "x-grid3-cell-last " : ""));
        if (c.css != null) {
          buf.append(c.css);
        }
        if (showInvalidCells && r != null && !r.isValid(c.id)) {
          buf.append(" x-grid3-invalid-cell");
        }
        if (showDirtyCells && r != null && r.getChanges().containsKey(c.id)) {
          buf.append(" x-grid3-dirty-cell");
        }

        buf.append("\" style=\"");
        buf.append(c.style);
View Full Code Here

            Map<String, Map<String, List<GWTJahiaNode>>> workflowDefinitionMapMap = new HashMap<String, Map<String, List<GWTJahiaNode>>>();


            List<GWTJahiaPublicationInfo> all = new ArrayList<GWTJahiaPublicationInfo>();
            for (GWTJahiaNode node : nodes) {
                Record record = store.getRecord(node);
                for (GWTJahiaLanguage language : languages) {
                    if (record != null) {
                        Object o = record.get(language.getLanguage());
                        if (o != null && o instanceof Boolean) {
                            boolean checked = (Boolean) o;
                            if (checked) {
                                final List<GWTJahiaPublicationInfo> list =
                                        node.getFullPublicationInfos().get(language.getLanguage());
View Full Code Here

            return node.getAggregatedPublicationInfos() != null ? node.getAggregatedPublicationInfos().get(
                    getDataIndex()).getStatus() : 0;
        }

        private String getCheckState(GWTJahiaNode model, GWTJahiaPublicationInfo info) {
            Record record = grid.getStore().getRecord(model);
            boolean checked = false;
            if (record != null) {
                Object o = record.get(getDataIndex());
                if (o != null && o instanceof Boolean) {
                    checked = (Boolean) o;
                }
            }
            boolean wfStatus = getStatus(model, info);
View Full Code Here

            if (cls != null && cls.indexOf("x-grid3-cc-" + getId() + "-" + getDataIndex()) != -1 && cls.indexOf(
                    "disabled") == -1) {
                ge.stopEvent();
                int index = grid.getView().findRowIndex(ge.getTarget());
                ModelData m = grid.getStore().getAt(index);
                Record r = grid.getStore().getRecord(m);
                if (r.get(getDataIndex()) == null) {
                    r.set(getDataIndex(), Boolean.TRUE);
                } else {
                    boolean value = !((Boolean) r.get(getDataIndex()));
                    r.set(getDataIndex(), value);
//                    boolean b = checkboxMap.get(getDataIndex()).getStyleName().contains("x-grid3-check-col-on");
//                    if (!value && b) {
//                        checkboxMap.get(getDataIndex()).setValue(Boolean.FALSE);
//                    }
                }
View Full Code Here

   * Updates the model's value with the field value.
   */
  public void updateModel() {
    Object val = onConvertFieldValue(field.getValue());
    if (store != null) {
      Record r = store.getRecord(model);
      if (r != null) {
        r.setValid(property, field.isValid());
        r.set(property, val);
      }
    } else {
      model.set(property, val);
    }

View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.store.Record

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.