Hi everyone,

When I make a simple CellTable, the responsiveness of the table in the
browser to mouse events (mouseOver, mouseOut) is nowhere nearly as
fast as the table in the Showcase (http://gwt.google.com/samples/
Showcase/Showcase.html#!CwCellTable). Any ideas why this might be?

My code is below. Best,

~Owen

// Data object class.

package tabletest.client;

import java.util.ArrayList;

public class InterestingThing {

        public ArrayList<String> values = new ArrayList<String>();

        public InterestingThing(int n) {
                for (int i=0; i<n; i++) {
                        values.add("Value " + i);
                }
        }

}

// Custom CellTable class.

package tabletest.client;

import java.util.ArrayList;

import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.TextColumn;

public class MyCellTable extends CellTable<InterestingThing> {

        public MyCellTable() {
                super();

                int NUM_COLUMNS = 4;
                int NUM_ROWS = 25;

                // Create table.
                for (int i=0; i<NUM_COLUMNS; i++) {
                        addTextColumn(i);
                }

                // Create data.
                ArrayList<InterestingThing> data = new
ArrayList<InterestingThing>();
                for (int i=0; i<NUM_ROWS; i++) {
                        data.add(new InterestingThing(NUM_COLUMNS));
                }

                // Put data into table.
                setRowData(0, data);
        }

        private void addTextColumn(final int i) {
                TextColumn<InterestingThing> newColumn = new
TextColumn<InterestingThing>() {

                        public String getValue(InterestingThing m) {
                                return m.values.get(i);
                        }
                };
                addColumn(newColumn, "Field " + i);
        }

}

// Entrypoint.

package tabletest.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class TableTest implements EntryPoint {

        public void onModuleLoad() {

                MyCellTable table = new MyCellTable();
                RootPanel.get().add(table);
        }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to