package com.extjs.gxt.ui.client.widget.grid;

import java.util.List;

import jp.co.kpscorp.gwt.client.design.gxt.widget.ColumnModelWidget;

import com.extjs.gxt.ui.client.store.ListStore;

public class GridHelper {
	/**
	 * added by k.taira
	 * 
	 * @param cm
	 */
	public static void setColumnModel(Grid grid, ColumnModel cm) {
		grid.cm = cm;
		ColumnModelWidget cmw = grid.getData(ColumnModelWidget.class.getName());
		if (cmw != null) {
			cmw.setColumnModel(cm);
		}
	}

	/**
	 * added by k.taira
	 * 
	 * @param store
	 */
	public static void setStore(Grid grid, ListStore store) {
		grid.store = store;
	}

	public static List<ColumnConfig> getConfig(ColumnModel cm) {
		return cm.config;
	}

	public static void setConfig(ColumnModel cm, List<ColumnConfig> list) {
		cm.config = list;
	}

}
