diff options
author | xue <> | 2006-02-20 06:23:38 +0000 |
---|---|---|
committer | xue <> | 2006-02-20 06:23:38 +0000 |
commit | 3dcb3c4188c8d5836a2db0847d2fc43bc7e7e4d8 (patch) | |
tree | 2c3d8ec78c40f314061225b76b41a126fd5fb098 /framework/Web/UI/TClientScriptManager.php | |
parent | d830818a513a255e2ae047e7d0057238aa462f3d (diff) |
Cleaned up TForm and THead.
Diffstat (limited to 'framework/Web/UI/TClientScriptManager.php')
-rw-r--r-- | framework/Web/UI/TClientScriptManager.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php index 2fe67308..5ff5dba6 100644 --- a/framework/Web/UI/TClientScriptManager.php +++ b/framework/Web/UI/TClientScriptManager.php @@ -174,6 +174,18 @@ class TClientScriptManager extends TApplicationComponent } /** + * Registers the control to receive default focus. + * @param TControl|string the control or the client ID of the HTML element to receive default focus + */ + public function registerFocusControl($target) + { + $this->registerPradoScript('prado'); + if($target instanceof TControl) + $target=$target->getClientID(); + $this->registerEndScript('prado:focus','Prado.Focus.setFocus("'.TJavaScript::quoteString($target).'");'); + } + + /** * @return array default button options. */ protected function getDefaultButtonOptions($panel, $button) @@ -418,12 +430,6 @@ class TClientScriptManager extends TApplicationComponent if($str!=='') $writer->write("<div>\n".$str."</div>\n"); } - - public function registerFocusScript($target) - { - $this->registerPradoScript('prado'); - $this->registerEndScript('prado:focus','Prado.Focus.setFocus("'.TJavaScript::quoteString($target).'");'); - } } ?>
\ No newline at end of file |