0

如何在 kendo ui 编辑器中添加行号。我没有看到任何启用行号的设置 http://docs.telerik.com/kendo-ui/controls/editors/editor/overview

4

1 回答 1

0

有一条使用CSS3 Counters的路线。我对剑道编辑器不熟悉,所以一定要在 CSS中添加除 thep和base 子元素之外的任何其他元素。ul > li

您可以保存以下 CSS 以在编辑器中加载:

body {
    counter-reset: editor;
    padding-left: 3em;
}
body > p,
body > ul > li {
    counter-increment: editor;
}
body > p:before,
body > ul > li:before {
    content: counter(editor);
    background: #CCC;
    position: absolute;
    left: 1em;
    height: 100%;
    width: 2em;
}

要在编辑器中添加自定义 CSS,您可以将上述内容保存到文件中并在初始化中:

$("#editor").kendoEditor({
    stylesheets: ["path_to_your.css"]
});
于 2016-06-21T19:50:55.757 回答