package com.sample.test.client;

import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;

public class SampleGrid extends ListGrid{
	
	private DataSource ds;
	public SampleGrid(){
		
		ds = SampleDataSource.getInstance();
		if (ds != null) {
			setDataSource(ds);
		}
		setAutoFetchData(false); 
		setAutoSaveEdits(false);
		setSaveLocally(true);
		setCanEdit(true);
		addGridColumns();
		fetchData();
		
	}

	private void addGridColumns() {
		
		ListGridField idField = new ListGridField("Name");
		ListGridField isTrueField = new ListGridField("isTrue");
		setFields(idField,isTrueField);
		
		
	}
	
	
}
