rice-framework/krad-web/src/main/webapp/krad/scripts/krad.utility.js
/**
 * Focus the control and place the cursor at the end of the content (when applicable).
 *
 * @param $control the control to be focused
 */
Focus the control and place the cursor at the end of the content (when applicable).

@param $control the control to be focused
Focus the control and place the cursor at the end of the content ( when applicable ) . @param $control the control to be focused
function focusEnd($control) {
    var control = $control[0];
    if (control != null && control.value.length != 0 && $control.is(":text,textarea")) {
        if (control.createTextRange) {
            var FieldRange = control.createTextRange();
            FieldRange.moveStart('character', control.value.length);
            FieldRange.collapse();
            FieldRange.select();
        } else if (control.selectionStart || control.selectionStart == '0') {
            var elemLen = control.value.length;
            control.selectionStart = elemLen;
            control.selectionEnd = elemLen;
            control.focus();
        }
    } else {
        $control.focus();
    }
}
function focusEnd ( $control ) { var control = $control [ 0 ] ; if ( control != null && control . value . length != 0 && $control . is ( ":text,textarea" ) ) { if ( control . createTextRange ) { var FieldRange = control . createTextRange ( ) ; FieldRange . moveStart ( 'character' , control . value . length ) ; FieldRange . collapse ( ) ; FieldRange . select ( ) ; } else if ( control . selectionStart || control . selectionStart == '0' ) { var elemLen = control . value . length ; control . selectionStart = elemLen ; control . selectionEnd = elemLen ; control . focus ( ) ; } } else { $control . focus ( ) ; } }
Focus the control and place the cursor at the end of the content (when applicable).
Focus the control and place the cursor at the end of the content ( when applicable ) .