Hi, the following options would be very cool:
1. Hide row labels - Be able to hide the row labels on display
2. Hide empty rows - If the row has no data, do not show it.

I have a variable content list I want shown where the only static bit is the # columns. Think like an inventory system, first column is the item, second is the quantity; the base page does not know what 'stuff' I want listed on each row and I don't need some placeholder in a starting column header.

Thanks!

CommentFileSizeAuthor
#5 Picture 8.png31.2 KBamariotti

Comments

murz’s picture

Subscribe.

SamStealth’s picture

Subscribe.

duntuk’s picture

subscribing

amariotti’s picture

I'm not sure why some developers don't jump in and make this happen. If I had the knowledge then I would for sure. This is an absolute necessity in this module. I'll see if I can get a friend of mine on board. Anyone else interested?

amariotti’s picture

StatusFileSize
new31.2 KB

I was able to get my developer friend to help me out a little bit with this and this is what he came up with.

My main request was to have the row not display if the user left the field empty. My need was very specific (see attached image) though. I end up put n-spaces in about 15 of the rows just to make sure that they show up on the content_type form. What will happen though is some programs (or courses) will only need 10 of the rows and others will need all 15. Anyway, so after the discussion we had last night we determined that the best thing to do would be to change the function so that if the value that is returned is empty then it will ignore that row. Here's the function that changed:

function theme_matrix_table_view($node_field, $field) {
  $header[] = '';
  for ($i=1; $i<= MATRIX_NUMBER; $i++) {
    if (!empty($field['label_column_'.$i])) {
      $header[] = $field['label_column_'.$i];
    }
    $rows = NULL;
    if (!empty($field['label_row_'.$i])) {
      
      if($node_field[$i]) {
          $rows[] = $field['label_row_'.$i];
      }
      for ($j=1; $j<= MATRIX_NUMBER; $j++) {
        if (!empty($node_field[$i][$j])) {
          $rows[] = $node_field[$i][$j];
        }
      }
    }
    if ($rows) $row[] = $rows;
  }
  return theme('table', $header, $row, array());
}

Send praises to: Chuck

I'll talk to him about submitting a patch. Does everyone think that this would be a good patch or am I the only one that would need this?

Andrew
amariotti.com

aaron1234nz’s picture

Status: Active » Needs review

Thanks amariotti/Chuck I'll take a look

aaron1234nz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pareen’s picture

Version: 5.x-1.x-dev » 6.x-1.4

For header labels:

One way (not a very neat one) is to insert " " in the Header labels.

There will be no row headers then.