Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    format of DataSourceIntegerField

    Be sure your post includes:

    1. the SmartGWT2.4 }PRO
    2. It is a client-side problem


    Hello I want to change number format for DataSourceIntegerField.I had the some problem when I wanted to change size of column. I don't know how to change number format or size of columns. Is there any possibility how to change these items?

    There is the code:

    lg1.setDataSource(KatalogDataSource);
    lg1.setAutoFetchData(true);
    lg1.setCanEdit(false);

    lg1.setSelectionType(SelectionStyle.SINGLE);

    lg1.getField("CE").setCellFormatter(new CellFormatter() {
    @Override
    public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
    if(value == null) return null;

    String val = null;
    try {
    NumberFormat nf = NumberFormat.getFormat("0");
    val = nf.format(((Number) value).longValue());
    } catch (Exception e) {
    return value.toString();
    }
    return val;
    }
    });

    This code doesn't work.
    could you help me?

    BR
    Michal
    Last edited by felgr; 9 Jun 2011, 00:30.
Working...
X