Ext: tying the disabling of a button to the LABKEY.WebPart.render()

LabKey Support Forum (Inactive)
Ext: tying the disabling of a button to the LABKEY.WebPart.render() Ben Bimber  2012-05-12 08:25
Status: Closed
 
hi leo,

I have not tested these, but I believe a combination of these will help:

your button handler will be passed a reference to the button, so you can do something roughly like:

        new Ext4.Button({
            handler: function(btn) {
                mask.show();

                btn.setDisabled(true);

                // set graphWebPart config params to pass to the R script here
                graphWebPart.render();
            },
            renderTo: 'buttonGraph',
            text: 'Graph'
        });

then you can re-enable it whenever you need. the webpart probably supports a success callback:

        var graphWebPart = new LABKEY.WebPart({
            frame: 'none',
            partConfig: graphWebPartConfig,
            partName: 'Report',
            renderTo: 'Graph',
            scope: this,
            success: function(){ alert('loaded!');}
        });

and you could enable/disable your button from there, i think.