Jump to content

Resolved - MarkupAdminDataTable syntax issue


Recommended Posts

Trying to get an id attribute to the row

$table->row([$club->title, $club->id],['cid' => $club->id, $club->title, $club->club_status->title]);

The attribute is cid in the options part of this row - the row is not getting tagged with the cid - Am I missing something? This is being used in a Process module. Everything else in both parts works fine.

Link to comment
Share on other sites

When you build a table row, the attributes for that row need to go in an options array.

$data = [$club->title, $club->id];
$options = array();
$options['class'] = "class1 class2"; // class (string): specify one or more class names to apply to the <tr>
$options['attr'] = array('cid' => $club->id); // attrs (array): array of attr => value for attributes to add to the <tr> 
$table->row($data, $options);

Hope this helps.

Link to comment
Share on other sites

Strange - still not attaching the cid to the row. It is in a loop and I know it works as it is also in the data?

*I spotted that in the options code it should read plural attrs

Edited by opalepatrick
Resolved. I think
  • Like 1
Link to comment
Share on other sites

  • opalepatrick changed the title to Resolved - MarkupAdminDataTable syntax issue

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...