diff options
author | ctrlaltca@gmail.com <> | 2011-06-02 09:30:55 +0000 |
---|---|---|
committer | ctrlaltca@gmail.com <> | 2011-06-02 09:30:55 +0000 |
commit | 8aa0d56705a71894a80c1293730b6c67cddc8a40 (patch) | |
tree | fda6cea608f8fe2ade2f9a4f51e39c54846a3b17 /demos/quickstart/protected/pages/ActiveControls/Samples/TActiveDataGrid/Sample4.php | |
parent | 3baba6fb4b6c17ff77eb4a13a812ccde9263dce2 (diff) |
added documentation for TActiveDataList, TActiveDataGrid and TActiveRepeater class
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..eb1a0e5b --- /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 sortDataGrid($sender,$param)
+ {
+ $this->DataGrid->DataSource=$this->sortData($this->Data,$param->SortExpression);
+ $this->DataGrid->dataBind();
+ }
+}
+
+?>
\ No newline at end of file |