possible to listen for file download from LABKEY.ext.EditorGridPanel?

LabKey Support Forum
possible to listen for file download from LABKEY.ext.EditorGridPanel? Ben Bimber  2010-05-26 09:26
Status: Closed
 
ok, i've got a start on this and have a few questions:

1. according to the ext documentation, I should be able to specify a custom columnModel with an EditorGridPanel:

        var sopGrid = new LABKEY.ext.EditorGridPanel({
            store: new LABKEY.ext.Store({..})
            ,renderTo: 'sopDiv'
            ,width: 1000
            ,cm: new Ext.grid.ColumnModel({..})
        });

When the LABKEY.ext.EditorGridPanel first renders, my custom colModel is applied, but as soon as the Labkey store loads (and rows are populated) my custom colModel gets overridden by the default labkey behavior. Is there any way to define a custom colModel beforehand (in the store or something?), or do I need to add a handler to alter the colModel using the 'colmodelcustomize' event?


2. following the example in the labkey documentation for LABKEY.ext.EditorGridPanel, I can add a custom renderer. however, what's the right approach to add an onClick handler? following the example, we have something like:

function pdfRenderer(data, cellMetaData, record, rowIndex, colIndex, store)
{
   //run the existing renderer
   var theField = _basePdfRenderer(data, cellMetaData, record, rowIndex, colIndex, store);
   
   return theField;
}

in the above example, the default renderer produces a string with the URL for the file and display icon. what's the right point to manipulate this to add the handler? should I just discard the default renderer and build the URL / display icon HTML myself? can i somehow hook into this to add the handler in another way?

Hope this makes sense. Thanks for the help.