1. DJ Verlinden
  2. yii-bootstrap

Commits

Christoffer Niska  committed d23364b

fixed grid view sort headers

  • Participants
  • Parent commits 2c9a279
  • Branches 1.0.0-wip

Comments (0)

Files changed (1)

File widgets/BootDataColumn.php

View file
 	{
 		if ($this->grid->enableSorting && $this->sortable && $this->name !== null)
 		{
-			$label = isset($this->header) ? $this->header : $this->grid->dataProvider->getSort()->resolveLabel($this->name);
-			$label .= '<span class="caret"></span>';
-			echo $this->grid->dataProvider->getSort()->link($this->name, $label);
+			$sort = $this->grid->dataProvider->getSort();
+			$label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);
+
+			if ($sort->resolveAttribute($this->name) !== false)
+				$label .= '<span class="caret"></span>';
+
+			echo $sort->link($this->name, $label);
 		}
 		else
 		{