/* * Isomorphic SmartGWT web presentation layer * Copyright 2000 and beyond Isomorphic Software, Inc. * * OWNERSHIP NOTICE * Isomorphic Software owns and reserves all rights not expressly granted in this source code, * including all intellectual property rights to the structure, sequence, and format of this code * and to all designs, interfaces, algorithms, schema, protocols, and inventions expressed herein. * * If you have any questions, please email
. * * This entire comment must accompany any portion of Isomorphic Software source code that is * copied or moved from this file. */ package com.smartgwt.sample.showcase.client.dataintegration.java.sql; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.types.ListGridEditEvent; import com.smartgwt.client.types.ListGridFieldType; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.google.gwt.core.client.EntryPoint; public class LiveGridFetchSample implements EntryPoint { @Override public void onModuleLoad() { DataSource dataSource = DataSource.get("supplyItem"); ListGridField itemName = new ListGridField("itemName", 235); ListGridField sku = new ListGridField("SKU", 100); ListGridField description = new ListGridField("description", 200); ListGridField category = new ListGridField("category", 200); ListGridField units = new ListGridField("units", 50); ListGridField unitCost = new ListGridField("unitCost", 70); unitCost.setType(ListGridFieldType.FLOAT); ListGridField inStock = new ListGridField("inStock", 100); inStock.setType(ListGridFieldType.BOOLEAN); ListGridField nextShipment = new ListGridField("nextShipment", 100); nextShipment.setType(ListGridFieldType.DATE); final ListGrid listGrid = new ListGrid(); listGrid.setCanEdit(true); listGrid.setWidth(900); listGrid.setHeight100(); listGrid.setAutoFetchData(true); listGrid.setDataSource(dataSource); listGrid.setEditEvent(ListGridEditEvent.DOUBLECLICK); listGrid.setModalEditing(true); listGrid.setShowRowNumbers(true); listGrid.setFields(itemName, sku, description, category, units, unitCost); listGrid.draw(); } }