I'm working on an ASP.NET MVC application which is using Kendo ui in it. We have used a Kendo UI Editor in it for rich texts. It is being used as follows:
@(Html.Kendo().Editor()
.Name("textControl-Source")
.Tools(tools => tools.Clear()
.Bold().Italic().Underline().Strikethrough()
.FontSize().FontColor().BackColor()
.JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
.InsertUnorderedList().InsertOrderedList().Indent().Outdent()
.SubScript().SuperScript())
.HtmlAttributes(new { style = "height:240px;width:98.5%", data_mintextlength = "1" })
.Events(events => events
.Change("mediaBoardEditNS.textControlChange")
.Select("mediaBoardEditNS.textControlSelect")
)
)
There is a requirement if we can somehow customize it to show custom colors by using HEX codes like we can do in Microsoft Word font color picker. I have searched a lot on their forum and SO as well, but couldn't find anything solid. Let me know if i'm missing something. Thanks
This isn't going to be an exact-code answer, as I'm not 100% clear of your exact requirement. I think this may be enough to get you on the right track though.
If you requirement is simpler and you only need to include custom colors in the backColor and foreColor tools, there is a way to customize the palette that is available. As shown in this dojo, you can customize the palette's like so:
However, I don't think that's what your requirement is exactly as you mention making it like MS Word. I'll leave it in though in case I'm wrong.
So, with that in mind. there is also the ability to create custom tools: Example 1 Example 2
You can create a custom tool for both backColor and foreColor that consists of a Kendo ColorPicker in it's template. That along with using the events of the picker would allow the user to select any color or enter a HEX value, and upon clicking apply, you can then set the Editor backColor/foreColor appropriately.
Something along the lines of this, however you'd have to adapt it to work within a template:
Telerik forum reference for the initial dojo