package com.mackemlad.sizing.client;

import com.google.gwt.core.client.EntryPoint;
import com.mackemlad.sizing.client.data.OrderLocalDS;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.Record;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.types.SortArrow;
import com.smartgwt.client.util.KeyCallback;
import com.smartgwt.client.util.Page;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VStack;
import com.smartgwt.client.widgets.viewer.DetailViewer;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Sizing implements EntryPoint {

    /**
     * This is the entry point method.
     */
    public void onModuleLoad() {
        OrderLocalDS dataSource = OrderLocalDS.getInstance();  
        
        ListGridField orderNumber = new ListGridField("orderNumber");  
        ListGridField itemsCost = new ListGridField("itemsCost");  
        ListGridField itemsRetail = new ListGridField("itemsRetail");  
        ListGridField marginPercent = new ListGridField("marginPercent");  
  
        final ListGrid listGrid = new ListGrid();  
  
        listGrid.setWidth(600);  
        listGrid.setHeight(520);  
        listGrid.setAutoFetchData(true);  
  
        listGrid.setShowAllRecords(true);  
        listGrid.setDataSource(dataSource);  
        listGrid.setCanEdit(false);  
        listGrid.setShowGridSummary(true);  
        listGrid.setShowGroupSummary(true); 
        listGrid.setApplyFormulaAfterSummary(true);
  
        listGrid.setFields(orderNumber, itemsCost, itemsRetail, marginPercent);  
  
        listGrid.draw();  
    }   
}
