The controller is returning the HtmlEncoded contents of a text file that the server reads in from the local operating system on the server, and I would like to display that information in a window or editor such that there is a left hand 'gutter' displaying line numbers and the file content has vertical and horizontal scroll bars. The line numbers would scroll-y with the content, but should be fixed with respect to scroll-x.
A good example would be
- the code panel in the Sources tab in Chrome developer tools, or
- http://jspro.brothercake.com/code-examples/principle5.html, or
- http://alan.blog-city.com/jquerylinedtextarea.htm (not my first choice though)
This dojo demonstrates a close solution I made using Window.
https://dojo.telerik.com/@RichardAD/IJuLeyOv
The 'gutter' is not locked (or fixed) though. After many iterations I though of the Editor component and how it might already have line numbers built into it, and I could use it in a read-only manner to display the text file contents with line-numbers.
Hi Richard,
Thank you for the additional information. I changed the product to Kendo UI for jQuery as this request is related to creation of a new widget - CodeEditor.
Regards,
Ianko
Progress Telerik
The line numbers would not be editable, so they would not be positioned in the editing area and only appear in the view rendering.
If Kendo could 'extend' the editor to a limited role editor that would be great. I.e. Kendo TextEditor.
A second idea would be Kendo CodeEditor (plain text or syntax highlights according to contextual language detection of contents, or per editor configuration setting)
Hi Richard,
The Kendo Editor by design aims rich text editing. The suggestion you describe is more suitable to code viewer or code editor, where there is no rich text editing.
Can you please clarify whether the line numbers should be position in the editing area of the Kendo Editor or the viewHtml tool of the editor?
If you require a code editor/viewer component this feature request can be handled only by creating an entirely new component for that scenario as the Editor is not suitable for that by design.
Regards,
Ianko
Progress Telerik