I am using ng-grid. In ng-grid I have few textbox along with a button. By clicking the button, one ace editor is going to open where I can edit/add the text. But when I am clicking the button, there is no focus(no cursor blink) on the editor, I have to manually click on the editor to get the focus. Here are portion of my html and js file code
html:
<div class="modal fade" id="valueModal" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button id="mbx-procsr-properties-closeFile" type="button" class="close" data-dismiss="modal" aria-hidden="true">X</button>
<h4 class="modal-title">Edit Value</h4>
</div>
<div class="modal-body">
<div ui-ace="{onLoad : loadValueData,
theme : 'chaos',
useWrapMode : true,
showGutter: true,
mode: 'json'
}">
</div>
<div class="modal-footer">
<button id="mbx-procsr-properties-close" type="button" class="btn btn-default" data-dismiss="modal" ng-click="close()">Close</button>
</div>
</div>
</div>
</div>
</div>
Javascript:
$scope.loadValueData = function (_editor) {
editor = _editor;
_editor.getSession().setUseWorker(false);
_editor.focus();
};
I want the focus/cursor blink on ace editor
I am giving you the snippet code of ng-grid-gridOptionsForProcessor
<textarea class="form-control" ng-model="COL_FIELD" style="width:90%;height:45px" placeholder="required" />\n\
<a ng-click="isModal(row)" data-toggle="modal" data-backdrop="static" data-keyboard="false" data-target="#valueModal" class="right">\n\
<i class="glyphicon glyphicon-new-window"></i>
\n\
and the content of isModal is
$scope.isModal = function (row) {
rowObj = row;
editor.setValue(row.getProperty('value').toString());
so is it possible to set the focus in isModal