diff options
author | Christophe.Boulain <> | 2009-09-29 08:33:46 +0000 |
---|---|---|
committer | Christophe.Boulain <> | 2009-09-29 08:33:46 +0000 |
commit | d76123127139a7cb013a0e4c17a63eb8aab57e3e (patch) | |
tree | 4a6093cec85636f5e595b66f4fb33f77f1d424e1 /demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php | |
parent | b49bc6e7db63f0ae9788970108c4d2f20d841bed (diff) |
Added TActiveDataGrid and TActiveRepeater from LCS
Diffstat (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php')
-rw-r--r-- | demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php new file mode 100644 index 00000000..80a9c8bc --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php @@ -0,0 +1,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 sorTActiveDataGrid($sender,$param)
+ {
+ $this->DataGrid->DataSource=$this->sortData($this->Data,$param->SortExpression);
+ $this->DataGrid->dataBind();
+ }
+}
+
+?>
\ No newline at end of file |