Jump to content

MarkupAdminDataTable Actions Not Displaying


rick
 Share

Recommended Posts

Has anyone run into the actions set for MarkupAdminDataTable not being shown?

// Example code:
$table =$this->wire('modules')->get('MarkupAdminDataTable');
$table->setEncodeEntities(false);
$table->setSortable(true);
$table->action = array('Home' => './');
$table->headerRow(['Name', something']);// yes, i use two array syntaxes for testing
$table->row( array( "Red Skelton", "some data" ) );
$table->render();
// End Example code


// MarkupAdminDataTable.module 
// line 229:
public function action(array $action) {
  foreach($action as $label => $url) { 
 	 $this->actions[$label] = $url;
  }
  return $this;
}

// And line 317:
if(count($this->actions)) {
    $out .= "\n<p>";
    foreach($this->actions as $label => $url) {
      /** @var InputfieldButton $button */
      $button = $this->modules->get("InputfieldButton"); 
      $button->href = $url;
      $button->value = $label;
      $out .= $button->render();
    }
	$out .= "\n</p>";
}

return $out; 

The table is displayed correctly, minus the action. There is no dom reference in dev tools for the action -- as if it was ignored. Tracy (bd($table);) shows the action as defined.

What am I overlooking?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...