summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php
diff options
context:
space:
mode:
authorChristophe.Boulain <>2009-09-29 08:33:46 +0000
committerChristophe.Boulain <>2009-09-29 08:33:46 +0000
commitd76123127139a7cb013a0e4c17a63eb8aab57e3e (patch)
tree4a6093cec85636f5e595b66f4fb33f77f1d424e1 /demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php
parentb49bc6e7db63f0ae9788970108c4d2f20d841bed (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.php21
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