how to delete the content of ace editor on a validation error

别来无恙 提交于 2019-12-10 18:04:45

问题


My question is related to set focus on ace editor

This time I want to delete the content whenever there is a validation error.

I have the used the pattern like

/^[0-4]$/ and /^([1-9][0-9]{0,3}|[1-5][0-9]{4}|60000)$/;

to check the value between 0-4 and 1-60000 respectively. When user provides invalid data my text area is cleared but not the ace editor. I also tried

    $scope.close = function () {
rowObj.entity.value = editor.getValue();
            editor.setValue("",0);
                };

but that is not working.


回答1:


to clear editor simply call editor.setValue("")



来源:https://stackoverflow.com/questions/22686397/how-to-delete-the-content-of-ace-editor-on-a-validation-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!