Search in sources :

Example 1 with RowCell

use of cn.cerc.jpage.grid.RowCell in project summer-mis by cn-cerc.

the class ExpenderGridLine method output.

@Override
public void output(HtmlWriter html, int lineNo) {
    DataSet dataSet = dataSource.getDataSet();
    html.print("<tr");
    html.print(" id='%s_%s'", "tr" + dataSet.getRecNo(), lineNo);
    html.print(" role=\"%s\"", dataSet.getRecNo());
    if (!this.isVisible())
        html.print(" style=\"display:none\"");
    html.println(">");
    for (RowCell item : this.getCells()) {
        IField objField = item.getFields().get(0);
        html.print("<td");
        if (item.getColSpan() > 1)
            html.print(" colspan=\"%d\"", item.getColSpan());
        if (item.getStyle() != null)
            html.print(" style=\"%s\"", item.getStyle());
        if (item.getAlign() != null)
            html.print(" align=\"%s\"", item.getAlign());
        else if (objField.getAlign() != null)
            html.print(" align=\"%s\"", objField.getAlign());
        if (item.getRole() != null)
            html.print(" role=\"%s\"", item.getRole());
        html.print(">");
        for (IField obj : item.getFields()) {
            if (obj instanceof AbstractField) {
                AbstractField field = (AbstractField) obj;
                html.print("<span>");
                if (!"".equals(field.getName())) {
                    html.print(field.getName());
                    html.print(": ");
                }
                if (field instanceof IColumn)
                    html.print(((IColumn) field).format(dataSource.getDataSet().getCurrent()));
                else if (field instanceof AbstractField)
                    outputField(html, field);
                else
                    throw new RuntimeException("暂不支持的数据类型:" + field.getClass().getName());
                html.println("</span>");
            }
        }
        html.println("</td>");
    }
    html.println("</tr>");
}
Also used : AbstractField(cn.cerc.jpage.fields.AbstractField) DataSet(cn.cerc.jdb.core.DataSet) IColumn(cn.cerc.jpage.core.IColumn) RowCell(cn.cerc.jpage.grid.RowCell) IField(cn.cerc.jpage.core.IField)

Example 2 with RowCell

use of cn.cerc.jpage.grid.RowCell in project summer-mis by cn-cerc.

the class ExpenderGridLine method addField.

@Override
public void addField(IField field) {
    getFields().add(field);
    RowCell col;
    if (getCells().size() == 0) {
        col = new RowCell();
        getCells().add(col);
    } else
        col = getCells().get(0);
    col.addField(field);
}
Also used : RowCell(cn.cerc.jpage.grid.RowCell)

Example 3 with RowCell

use of cn.cerc.jpage.grid.RowCell in project summer-mis by cn-cerc.

the class ChildGridLine method output.

@Override
public void output(HtmlWriter html, int lineNo) {
    html.print("<tr");
    html.print(" id='%s_%s'", "tr" + dataSource.getDataSet().getRecNo(), lineNo);
    if (!this.isVisible())
        html.print(" style=\"display:none\"");
    html.println(">");
    for (RowCell item : this.getCells()) {
        IField objField = item.getFields().get(0);
        html.print("<td");
        if (item.getColSpan() > 1)
            html.print(" colspan=\"%d\"", item.getColSpan());
        if (item.getStyle() != null)
            html.print(" style=\"%s\"", item.getStyle());
        if (item.getAlign() != null)
            html.print(" align=\"%s\"", item.getAlign());
        else if (objField.getAlign() != null)
            html.print(" align=\"%s\"", objField.getAlign());
        if (item.getRole() != null)
            html.print(" role=\"%s\"", item.getRole());
        else if (item.getFields().get(0).getField() != null)
            html.print(" role=\"%s\"", item.getFields().get(0).getField());
        html.print(">");
        for (IField obj : item.getFields()) {
            if (obj instanceof AbstractField) {
                AbstractField field = (AbstractField) obj;
                if (field instanceof IColumn)
                    html.print(((IColumn) field).format(dataSource.getDataSet().getCurrent()));
                else if (field instanceof AbstractField)
                    outputField(html, field);
                else
                    throw new RuntimeException("暂不支持的数据类型:" + field.getClass().getName());
                if (field.getTitle() != null && !"".equals(field.getTitle()))
                    html.print("<span style='float: left;'>%s:</span> ", field.getTitle());
            }
        }
        html.println("</td>");
    }
    html.println("</tr>");
}
Also used : AbstractField(cn.cerc.jpage.fields.AbstractField) IColumn(cn.cerc.jpage.core.IColumn) RowCell(cn.cerc.jpage.grid.RowCell) IField(cn.cerc.jpage.core.IField)

Example 4 with RowCell

use of cn.cerc.jpage.grid.RowCell in project summer-mis by cn-cerc.

the class ChildGridLine method addField.

@Override
public void addField(IField field) {
    getFields().add(field);
    RowCell col;
    col = new RowCell();
    col.setAlign(field.getAlign());
    col.setRole(field.getField());
    getCells().add(col);
    col.addField(field);
}
Also used : RowCell(cn.cerc.jpage.grid.RowCell)

Example 5 with RowCell

use of cn.cerc.jpage.grid.RowCell in project summer-mis by cn-cerc.

the class MasterGridLine method addField.

@Override
public void addField(IField field) {
    getFields().add(field);
    RowCell col;
    col = new RowCell();
    col.setAlign(field.getAlign());
    col.setRole(field.getField());
    getCells().add(col);
    col.addField(field);
}
Also used : RowCell(cn.cerc.jpage.grid.RowCell)

Aggregations

RowCell (cn.cerc.jpage.grid.RowCell)6 IColumn (cn.cerc.jpage.core.IColumn)3 IField (cn.cerc.jpage.core.IField)3 AbstractField (cn.cerc.jpage.fields.AbstractField)3 DataSet (cn.cerc.jdb.core.DataSet)2