diff options
author | mikl <> | 2008-07-03 17:24:50 +0000 |
---|---|---|
committer | mikl <> | 2008-07-03 17:24:50 +0000 |
commit | 09487ad04341c053ee3773a9371ddb00d1a29d66 (patch) | |
tree | cd5bd99a72ea6b7f9c7a4ff241cf45400ddcacc6 /demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php | |
parent | dda2b12bff4859dcbd86334e7f65b101dba58166 (diff) |
Added Autocomplete page to quickstart
Diffstat (limited to 'demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php')
-rw-r--r-- | demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php new file mode 100644 index 00000000..ca8a9e59 --- /dev/null +++ b/demos/quickstart/protected/pages/ActiveControls/Samples/TAutoComplete/Home.php @@ -0,0 +1,34 @@ +<?php
+// $Id$
+class Home extends TPage
+{
+ public function suggestNames($sender,$param) {
+ // Get the token
+ $token=$param->getToken();
+ // Sender is the Suggestions repeater
+ $sender->DataSource=$this->getDummyData($token);
+ $sender->dataBind();
+ }
+
+ public function suggestionSelected1($sender,$param) {
+ $id=$sender->Suggestions->DataKeys[ $param->selectedIndex ];
+ $this->Selection1->Text='Selected ID: '.$id;
+ }
+
+ public function suggestionSelected2($sender,$param) {
+ $id=$sender->Suggestions->DataKeys[ $param->selectedIndex ];
+ $this->Selection2->Text='Selected ID: '.$id;
+ }
+
+ public function getDummyData($token) {
+ // You would look for matches to the given token here
+ return array(
+ array('id'=>1, 'name'=>'John'),
+ array('id'=>2, 'name'=>'Paul'),
+ array('id'=>3, 'name'=>'George'),
+ array('id'=>4, 'name'=>'Ringo')
+ );
+ }
+}
+
+?>
|