mealsMenuGrid = function(){

   var colSelect = new Ext.grid.CheckboxSelectionModel();
   var colSummary = new Ext.ux.grid.GridSummary();

   var columns = [
        colSelect,
        {header: "Category",sortable: true, dataIndex: 'category'/*, groupRenderer: function(v) {return '<i>'+v+'</i>';}*/},
        {header: "Items", sortable: true, id: 'menuGridItems', dataIndex: 'item'},
        {header: "Price", sortable: true, renderer: Ext.util.Format.usMoney, dataIndex: 'amount', width: 80, align: 'right', summaryRenderer: function(v){return '<span class="">' + Ext.util.Format.usMoney(v) + '</span>'}}         
    ];

    mealsMenuGrid.superclass.constructor.call(this, {
        store: new Ext.data.GroupingStore({
            url : 'teacher_tools/meals_data.json.php',
            baseParams: {command: 'getMenu'},
            reader: new Ext.data.JsonReader({root: 'menu'}, [
              {name: 'entreeid'},
              {name: 'category'},
              {name: 'ordertype'},
              {name: 'item'},
              {name: 'amount', type:'double'}   
            ]),
            groupField:'category',
            sortInfo:{field: 'category', direction: "ASC"},
            autoLoad : false,
            listeners: {
               beforeload: function(store, options) { //only make a server call when all baseparams are set
                  return (store.baseParams.date != undefined && store.baseParams.meal != undefined);
               }
            }
        }),
        title: 'Food Choices',
        tbar:[{
            iconCls:'clear',
            text: 'Clear selected items',
            handler: function(btn) {
               mealsMenuGrid = this.ownerCt.ownerCt;
               mealsMenuGrid.selModel.clearSelections();
            }
        }],
        view: new Ext.grid.GroupingView({
            forceFit:true,
            showGroupName: false,
            enableNoGroups:false, // REQUIRED!
            hideGroupedColumn: true,
            getRowClass: function(row, index) {
               if (row.data.fake) return 'x-grid-group-body-hide';
            }
        }),
        id: 'mealsMenuGrid',
        columns: columns,
        sm:colSelect,
        border: true,
        plugins:[colSummary],
        layout: 'fit',
        autoScroll: true,
        autoExpandColumn: 'menuGridItems',
        enableColumnHide: false,
        enableColumnMove: false,
        enableColumnResize: false,
        enableDragDrop: true, //to allow dragging from source
        ddGroup: 'dd_meals_to_students' // the ddGroup defined by the drop target
    });
}

Ext.extend(mealsMenuGrid, Ext.grid.GridPanel);
