Salesforce Add Action To apex:EnhancedList

There’s no quick way to add actions to a Salesforce VisualForce page with an EnhancedList. Here’s the workaround.

    <script type="text/javascript">    
    function endsWith(str, suffix) {
        return str.indexOf(suffix, str.length - suffix.length) !== -1;
    function setActions() {        
        Ext.ComponentMgr.all.each( function(item, index, length) {
            if(endsWith(, "grid")) {        
                var store =;                    
       function(record) {
                    record.set("ACTION_COLUMN", ["My Action"]);
    <apex:enhancedList type="Systems__c" height="300" oncomplete="setActions();" />

Salesforce uses the Extjs framework ( to implement list views. All user interface components on an Extjs page are registered with a component manager. The code accesses the component manager, looks for a component whose id corresponds to a grid (our EnhancedList), and then changes the action items in the store associated with the grid.

Leave a Reply

Your email address will not be published. Required fields are marked *