function FileAttachmentGrid(){
    // shorthand alias
    var fm = Ext.form;
    var oThis = this;
    this.grid = new Object();
    this.data = new Object();
    var og = new Grid();

    // custom column plugin example
    var checkColumn = new Ext.grid.CheckColumn({
       header: "",
       dataIndex: 'row',
       id: 'row',
       type: 'bool',
       sortable: false,
       width: 30
    });
    
    var fields = [
        checkColumn,
        {id:'filename', header: "File Name", dataIndex: 'filename', type: 'string', width: 320, renderer: function(v) {return Ext.util.Format.ellipsis(v, 50);}},
        {id:'id', header: "Id", dataIndex: 'id', type: 'string', hidden: true}
    ];

    // the column model has information about grid columns
    // dataIndex maps the column to the specific data field in
    // the data store (created below)

    // this could be inline, but we want to define the Plant record
    // type so we can add records dynamically
    var createRecord = Ext.data.Record.create([
        {name: 'row', type: 'bool'},
        {name: 'filename', type: 'string'},
        {name:'id', type: 'string'}]);
    CRFA = createRecord
    // create the Data Store
    
    var store = new Ext.data.Store({
        // load using HTTP
        proxy: new Ext.data.HttpProxy({
					url: Ext.BASE_URL+'/autosuggest/getprovidermedia'
				}),
        sortInfo:{field: 'filename', direction: "ASC"},

        // the return will be XML, so lets set up a reader
        reader: new Ext.data.JsonReader({
            root: 'rows',
            totalProperty: 'results',
            idProperty: 'id',
            fields: [
                {name: 'row', type: 'bool'},
                {name: 'filename', mapping: 'media', type: 'string'},
                {name:'id', mapping: 'doc_id', type: 'string'}
            ]
        }),

        sortInfo:{field:'filename', direction:'ASC'}
    });

    // create the editor grid    
    var grid;
    var abcd = QoDesk.getModule('file-upload').launcher;
	
    grid = new Ext.grid.EditorGridPanel({
        store: store,
        cm: new Ext.grid.ColumnModel(fields),
        id: 'fileAttachmentGrid',
        autoExpandColumn: 'filename',
        width: 350,
        title:'Link Files',
        height: 200,
        frame: true,
        plugins: checkColumn,
        clicksToEdit: 2,
        /*autoShow: true,*/

        tbar: [{
            text: 'Add File',
            handler : abcd.hd,  //abcd.handler,
			//scope: abcd.scope,
            scope: [abcd.scope, store, createRecord],
            iconCls:'add'
        }, {
            text: 'Delete Selected',
            handler : function(){
                Ext.MessageBox.confirm('Confirm Delete', 'Do you really want to delete?', function(btn, text){
					if (btn == 'yes') {
						var s = store;
						s.suspendEvents();
						var c = og.getSelected(s);
						for(i=0; i<c.length; i++) {
							s.remove(c[i]);
						}
						s.resumeEvents();
						s.fireEvent('datachanged', s);
					}
				});
            },
            iconCls:'delete'
        }]
    });


    return grid;
    // trigger the data store load
    //store.load();
};


//FileBrowser = function(){
//    var xd = Ext.data;
//
//    var store = new Ext.data.JsonStore({
//        url: '/www/js/library/ExtJS/2.0/examples/view/get-images.php',
//        root: 'images',
//        fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date', dateFormat:'timestamp'}]
//    });
//    store.load();
//
//    var tpl = new Ext.XTemplate(
//		'<tpl for=".">',
//            '<div class="thumb-wrap" id="{name}">',
//		    '<div class="thumb"><img src="{url}" title="{name}"></div>',
//		    '<span class="x-editable">{shortName}</span></div>',
//        '</tpl>',
//        '<div class="x-clear"></div>'
//	);
//
//    return panel = new Ext.Panel({
//        /*id:'images-view',*/
//        /*frame:true,*/
//        width:535,
//        height:300,
//        /*autoHeight:true,*/
//        /*collapsible:true,*/
//        /*layout:'fit',*/
//        title:'Simple DataView with editable labels, multi and drag selection',
//        region: 'center',
//        items: new Ext.DataView({
//            store: store,
//            tpl: tpl,
//            autoHeight:true,
//            multiSelect: true,
//            overClass:'x-view-over',
//            itemSelector:'div.thumb-wrap',
//            emptyText: 'No images to display',
//
//            plugins: [
//                new Ext.DataView.DragSelector(),
//                new Ext.DataView.LabelEditor({dataIndex: 'name'})
//            ],
//
//            prepareData: function(data){
//                data.shortName = Ext.util.Format.ellipsis(data.name, 15);
//                data.sizeString = Ext.util.Format.fileSize(data.size);
//                data.dateString = data.lastmod.format("m/d/Y g:i a");
//                return data;
//            }
//        })
//    });
//};
