Adding another action link to grid rows

Discussion in 'Customization & add-ons' started by richard_hunter, Aug 14, 2017.

  1. richard_hunter

    richard_hunter New Member

    Joined:
    Jun 13, 2017
    Messages:
    3
    Hi, I'm looking for a way to add an additional action button to each row of the subusers grid.

    The button would simply need to link to PHP page and pass the user_id of the subuser in the query string.

    I can't see any obvious way to achieve this, can anyone point me in the right direction please?

    Many thanks :)
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Hello Richard,

    You can use the following code in site.php
    http://www.amember.com/docs/Site.php_file

    PHP:
    Am_Di::getInstance()->hook->add('gridSubusersUserInitGrid', function (Am_Event_Grid $e) {
        
    $e->getGrid()->actionAdd(new Am_Grid_Action_Url('myaction''My Action''/path/to?uid={user_id}'))
            ->
    setTarget('_top');
    });
    In case you want to use icon instead of text link then you need to put file myaction.png with your icon to folder:
    amember/application/default/views/public/img/icons

    Best Regards

Share This Page