New to Kendo UI for jQuery? Download free 30-day trial

Start Typing in Unordered List in Editor

Environment

Product Progress® Kendo UI® Editor for jQuery

Description

How can I achieve the following behavior?

  1. Have the first bullet in a list to appear automatically.
  2. Type the data you need.
  3. Open a new bullet line by pressing the Enter key after you finish typing.

Solution

Handle the select event of the widget and execute the insertUnorderedList command.

    <textarea id="editor"></textarea>

    <script>
      var shouldInsertList = true;
      $("#editor").kendoEditor({
        // Implement an event handler for the select event
        select: function(e) {
          // Set initially the Editor to start an unordered list
          if(shouldInsertList) {
            shouldInsertList = false;
            e.sender.exec("insertUnorderedList");
          }
        }
      });
    </script>

See Also

In this article