This is a migrated thread and some comments may be shown as answers.

Simple editor not working

4 Answers 116 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Cool Breeze
Top achievements
Rank 1
Cool Breeze asked on 22 Mar 2014, 02:36 PM

Hello, I have the following editor which is inside of a shared view:

@model Common.Models.Zone
 
<html>
    <head></head>
    <body>
        <table>
            <tr>
                <td>
                     @Html.LabelFor(zone => zone.Page)
                </td>
                <td>
                    @Html.Partial("PageSelector")
                </td>
            </tr>
            <tr>
                <td>
                     @Html.LabelFor(zone => zone.ZoneContents)
                </td>
                <td>
                  @(Html.Kendo().EditorFor(zone => zone.ZoneContents))
                </td>
            </tr>
        </table>
    </body>
</html>

The editor opens fine, but as soon as I try to apply any formatting to any text (if the text is "Test") and I try to bold "Test", when I click update I just get a bunch of errors in the jquery-1.8.2.js file. The error getting thrown is on line 5303 in the jquery file and the error message only says "SyntaxError".

How could such a simple example go so wrong? Are these controls really that difficult to get working correctly? Not all that impressed so far I have to say. I follow examples and things don't work. I start with the simplest possible configuration and things don't work. Also, if I set the name property on my editor the content property in my model is ALWAYS null when going back to the server.

What could I possibly be doing wrong here?

Thanks!


4 Answers, 1 is accepted

Sort by
0
Cool Breeze
Top achievements
Rank 1
answered on 22 Mar 2014, 02:47 PM
Just had to add the following attributes to my model property. It would be really nice if the examples actually included the models and pointed things out like this so that we don't have to go searching through forums and all of the other documentation just to make something work like it does in your examples.

[DataType(DataType.Html)]
[AllowHtml]
public string ZoneContents { get; set; }

0
Alexander Popov
Telerik team
answered on 26 Mar 2014, 07:12 AM
Thank you for your feedback.
We will consider updating our online examples, although this requirement is already mentioned in the Editor's getting started article

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Cool Breeze
Top achievements
Rank 1
answered on 26 Mar 2014, 11:38 PM
Yes, I have found that and that is great. Overall your documentation is great. It's just frustrating when you get to an example thinking you have everything you need to make it work only to find out there are things left out. That leaves you with hunting down the answers.

Not a big deal, just a little frustrating sometimes.

Thanks!
0
Cool Breeze
Top achievements
Rank 1
answered on 26 Mar 2014, 11:46 PM
That getting started article doesn't really actually mention this either. My problem was that it was just not responding and giving JS errors. This has nothing to do with html markup being shown in a control after validation takes place, because the form won't even let me submit in order to validate. For me to make the link between where it is mentioned in that article and my issue would have been a long shot, but I probably would have tried it anyway. The article also makes it sound as if it is optional. Maybe it's optional if you don't want your editor to work but if you want it to work you need the attribute on your model property, so if it is mandatory it should be in the example. I just think if you are going to show a working example, all the pieces should be there. Just my opinion of course. And once again, your documentation is really pretty great I'm just pointing out one source of frustration I have encountered.
Tags
Editor
Asked by
Cool Breeze
Top achievements
Rank 1
Answers by
Cool Breeze
Top achievements
Rank 1
Alexander Popov
Telerik team
Share this question
or