Add javascript to recordActions

From Achievo/ATK Wiki

Jump to: navigation, search

ATK Howto: Add javascript to recordActions

Complexity: easy
Author: Jorge Garifuna

List of other Howto's

Actually I just got this working by digging into the code of class.atkrecordlist.inc.

If the keyword "javascript:" is preappended to the url, a javascript function is automatically created.

Below is my working code to create popup from recordActions():

  public function recordActions($record, &$actions, &$mra)
  {
      $url = session_url(dispatch_url("somemodule.somenode", "helloworld"), SESSION_NESTED);
 
      $actions["hello"] = 'javascript:window.open ("'.$url.'","split","location=0,status=0,scrollbars=1,width=600,height=600")';
  }
Personal tools
Navigation