blob: eb1a0e5befa69f272395ae9e94b94e259abb30fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<?php
Prado::using('Application.pages.ActiveControls.Samples.TActiveDataGrid.Sample2');
class Sample4 extends Sample2
{
protected function sortData($data,$key)
{
$compare = create_function('$a,$b','if ($a["'.$key.'"] == $b["'.$key.'"]) {return 0;}else {return ($a["'.$key.'"] > $b["'.$key.'"]) ? 1 : -1;}');
usort($data,$compare) ;
return $data ;
}
public function sortDataGrid($sender,$param)
{
$this->DataGrid->DataSource=$this->sortData($this->Data,$param->SortExpression);
$this->DataGrid->dataBind();
}
}
?>
|