Skip to content

Commit

Permalink
Tweak to div template to apply element row class correctly. Haven't t…
Browse files Browse the repository at this point in the history
…ested in AJAX updates, probably won't work.
  • Loading branch information
cheesegrits committed Jan 19, 2018
1 parent 68169cd commit fd34cd5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions components/com_fabrik/models/element.php
Expand Up @@ -7443,7 +7443,10 @@ public function setRowClass(&$data)

if ($c !== false)
{
// added noRowClass and rowClass for use in div templates that need to split those out
$data[$groupKey][$i]->noRowClass = $data[$groupKey][$i]->class;
$data[$groupKey][$i]->class .= ' ' . FabrikString::getRowClass($c, $this->element->name);
$data[$groupKey][$i]->rowClass = FabrikString::getRowClass($c, $this->element->name);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion components/com_fabrik/views/list/tmpl/div/default.php
Expand Up @@ -86,8 +86,9 @@
foreach ($group as $this->_row) :
$items[] = $this->loadTemplate('row');
endforeach;
$class = 'fabrik_row well row-striped ' . $this->_row->class;
$class = 'fabrik_row well row-striped';
echo FabrikHelperHTML::bootstrapGrid($items, $columns, $class, true, $this->_row->id);

?>
</div>
<?php
Expand Down
3 changes: 3 additions & 0 deletions components/com_fabrik/views/list/tmpl/div/default_row.php
Expand Up @@ -13,7 +13,9 @@
// No direct access
defined('_JEXEC') or die('Restricted access');

$rowClass = isset($this->_row->rowClass) ? $this->_row->rowClass : '';
?>
<div class="<?php echo $rowClass; ?>">
<?php foreach ($this->headings as $heading => $label) :
$d = @$this->_row->data->$heading;
if (isset($this->showEmpty) && $this->showEmpty === false && trim(strip_tags($d)) == '') :
Expand All @@ -34,3 +36,4 @@
<?php
endforeach;
?>
</div>

0 comments on commit fd34cd5

Please sign in to comment.