Package com.smartgwt.sample.showcase.client.data

Examples of com.smartgwt.sample.showcase.client.data.CountryRecord


        gdpPerCapitaField.setCanEdit(false);
        gdpPerCapitaField.setAlign(Alignment.RIGHT);
        gdpPerCapitaField.setType(ListGridFieldType.FLOAT);
        gdpPerCapitaField.setCellFormatter(new CellFormatter() {
            public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                CountryRecord countryRecord = (CountryRecord) record;
                long gdpPerCapita = Math.round((countryRecord.getGdp() * 1000000000) / countryRecord.getPopulation());

                NumberFormat nf = NumberFormat.getFormat("0,000");
                return "$" + nf.format(gdpPerCapita);
            }
        });

        gdpPerCapitaField.setSortNormalizer(new SortNormalizer() {
            public Object normalize(ListGridRecord record, String fieldName) {
                CountryRecord countryRecord = (CountryRecord) record;
                return countryRecord.getGdp() / countryRecord.getPopulation();
            }
        });

        countryGrid.addEditorExitHandler(new EditorExitHandler() {
            public void onEditorExit(EditorExitEvent event) {
View Full Code Here

TOP

Related Classes of com.smartgwt.sample.showcase.client.data.CountryRecord

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.