diff options
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 |