Skip to content

Commit

Permalink
Add option to change sort handle
Browse files Browse the repository at this point in the history
  • Loading branch information
martinknor committed Feb 7, 2016
1 parent 93ca98d commit 8e8ec97
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/DataGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ class DataGrid extends Nette\Application\UI\Control
* @var bool
*/
protected $sortable = FALSE;

/**
* @var string
*/
protected $sortableHandle = 'sort';

/**
* @var string
Expand Down Expand Up @@ -500,6 +505,18 @@ public function setSortable($sortable = TRUE)
}


/**
* Set sortable handle
* @param string $handle
*/
public function setSortableHandle($handle = 'sort')
{
$this->sortableHandle = (string) $handle;

return $this;
}


/**
* Tell whether DataGrid is sortable
* @return bool
Expand All @@ -509,6 +526,15 @@ public function isSortable()
return $this->sortable;
}

/**
* Return sortable handle name
* @return string
*/
public function getSortableHandle()
{
return $this->sortableHandle.'!';
}


/**
* Is tree view set?
Expand Down

0 comments on commit 8e8ec97

Please sign in to comment.