如何获得Kendo UI编辑器内容的选定值 [英] How to get selected value of Kendo UI Editor content

查看:121
本文介绍了如何获得Kendo UI编辑器内容的选定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要插入自定义编辑器工具,以将链接插入到RTF中.它应该可以作为编辑器中的基本链接插入,但是在对话框窗口中,我需要树状视图以及我们的文档结构来选择链接目标.

I need insert custom editor tool for inserting links into rich text. It should work as basic link insert in editor but in dialog window I need treeview with our documents structure for select target of link.

请帮我提供语法以获取编辑器内容的选定文本吗?

Please can you help me with syntax for get selected text of editor content?

最诚挚的问候 大卫

推荐答案

要从Kendo编辑器中获取选定的文本,可以使用GetRange()方法.语法如下.( http://docs.kendoui.c​​om/api/web/编辑器#methods-getRange )

To get selected text from the Kendo Editor you can use GetRange() method. Syntax is following.(http://docs.kendoui.com/api/web/editor#methods-getRange)

http://jsfiddle.net/vojtiik/Sgtxk/1/

HTML:

  <textarea id="editor"></textarea>
  <input class="buttonB" type="button" value="Get selected value" />

JS:

    var textarea = $("#editor");
    textarea.kendoEditor({ value: "Hello Davide, how are you doing !" });
    var editor = textarea.data("kendoEditor");

    $('.buttonB').click(function () {
        alert(editor.getRange());
    });

这篇关于如何获得Kendo UI编辑器内容的选定值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆