Does anyone know where can I find the even list of a Text Field?
I need the focus event, and can't find his name
If you want to set focus, you can just use jQuery:
$('#textFieldId').focus();
If you wish to handle events, see SC.EventDispatcher for a list of supported events. I think you want focusIn or focusOut.
focusIn
focusOut
var event, events = { touchstart : 'touchStart', touchmove : 'touchMove', touchend : 'touchEnd', touchcancel : 'touchCancel', keydown : 'keyDown', keyup : 'keyUp', keypress : 'keyPress', mousedown : 'mouseDown', mouseup : 'mouseUp', click : 'click', dblclick : 'doubleClick', mousemove : 'mouseMove', focusin : 'focusIn', focusout : 'focusOut', mouseenter : 'mouseEnter', mouseleave : 'mouseLeave', submit : 'submit', change : 'change', dragstart : 'dragStart', drag : 'drag', dragenter : 'dragEnter', dragleave : 'dragLeave', dragover : 'dragOver', drop : 'drop', dragend : 'dragEnd' };
For example:
App.TextBoxView = SC.TextField.extend({ attributeBindings: ['type', 'placeholder', 'value', 'name', 'tabindex', 'disabled', 'readonly'], name: '', tabindex: '1', disabled: NO, readonly: NO, focusIn: function(event) { // your code return false; }, focusOut: function(event) { this._elementValueDidChange(); return false; } });
Copyright © 2021 Jogjafile Inc.
If you want to set focus, you can just use jQuery:
If you wish to handle events, see SC.EventDispatcher for a list of supported events. I think you want
focusIn
orfocusOut
.For example: