columns = ['', 'A', 'B', 'C', 'D', 'E', 'F','G', 'H', 'I'];
numRows = 15;

ResolverGrid = {

    init: function(onHide){
        // shorthand alias
        var fm = Ext.form;
    
        // the column model has information about grid columns
        cols = Array(columns.length);
        
        // The row index is not editable
        cols[0] = {
           header: '',
           width: 100,
           dataIndex: ''
        };
        
        for (index = 1; index < columns.length; index++) {
            col = columns[index];
            
            editor = new Ext.grid.GridEditor(new fm.TextField({ allowBlank: true }));
            editor.on('hide', onHide);
            cols[index] = {
               header: col,
               dataIndex: col,
               width: 100,
               editor: editor,
               sortable: false
            };
        }
        
        cm = new Ext.grid.ColumnModel(cols);
        cm.defaultSortable = false;
        
        // Create the multi-dimensional array containing the initial data
        data = Array(numRows);
        for (index = 0; index < numRows; index++) {
            data[index] = Array(columns.length);
            data[index][0] = index + 1;
            for (i = 1; i < data[index].length; i++) {
                data[index][i] = '';
            }
        }
        
        // A Simple datastore based on arrays
        dataStore = new Ext.data.SimpleStore({ fields: columns, data: data, id: 0 });
        
    
        // create the editor grid
        gridConfig = {
            colModel: cm,
            ds: dataStore
        }
        grid = new Ext.grid.EditorGrid('editor-grid', gridConfig);
    
        layout = Ext.BorderLayout.create({
            center: {
                margins: {left: 3, top: 3, right: 3, bottom: 3},
                panels: [new Ext.GridPanel(grid)]
            }
        }, 'grid-panel');
    
        // render it
        grid.render();
        
        this.grid = grid;
        this.store = dataStore;
    }
}



