This example shows how to use the client-side API of Telerik Editor for ASP.NET MVC.
To use the client-side API you should first retrieve the Editor client-side object. The following code snippet shows how to do this:
<script type="text/javascript">
function getEditor(){
//"Editor" is the value specified by the Name() method.
var editor = $("#Editor").data("tEditor");
return editor;
}
</script>
Available client-side methods:
function selectAll() {
var editor = getEditor(); // Create Editor object.
range = editor.createRange();
...
}
function selectAll() {
var editor = getEditor(); // Create Editor object.
...
editor.selectRange(range);
}
function textBold() {
var editor = getEditor(); // Create Editor object.
...
editor.exec("bold");
}