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

ASP.NET MVC server wrapper for CleanFormatting missing

6 Answers 81 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 17 Jul 2014, 07:52 AM
Hi,

just updated the Kendo Version to 2014 Q2 and wanted to insert the CleanFormatting Tool for the editor, but it doesn't show up in visual studio.
If I add .CleanFormatting() manually to the list it shows me an compiler error.
The new file browser works fine, so I think I updated the files correctly.
In the all tools online demo from in the all_tools.cshtml the clean formatting button shows up but there is not implementation in razor.

Am I missing something?

Regards
Mark

6 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 17 Jul 2014, 08:33 AM
Hello Mark,

I am afraid that the fluent interface was (wrongly) omitted from the official release. It has been added and will be available in the upcoming internal builds.

As a work-around, you can use it via a custom button:

        .CustomButton(c => c
             .Name("cleanFormatting")
             .Exec("function() { this.exec('cleanFormatting'); }")
        )

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Mark
Top achievements
Rank 1
answered on 17 Jul 2014, 08:36 AM
This worked.

Thank you very much

Best regards
Mark
0
Mark
Top achievements
Rank 1
answered on 18 Jul 2014, 10:26 AM
Hi,

the button now is in fact available in the editor but if I click on the button nothing happens.
In the console appears the following text:

Detected Kendo UI version: "2014.2.716" VM916:5454
Uncaught TypeError: undefined is not a function    Create:109
jQuery.kendoEditor.tools.exec    Create:109
b.isFunction.ijquery-1.9.1.js:7223
b.event.dispatchjquery-1.9.1.js:9593
v.handlejquery-1.9.1.js:9273

Is there anything missing?

Here is how we implement the editor: 
@(Html.Kendo()
                      .EditorFor(model => model.Content)
                      .HtmlAttributes(new { style = "width: 740px;height:440px" })
                      .Encode(true)
                      .Tools(tools => tools
                                                  .Clear()
                  .Bold().Italic().Underline().Strikethrough()
                  .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
                  .InsertUnorderedList().InsertOrderedList()
                  .Outdent().Indent()
                  .CreateLink().Unlink()
                  .InsertImage()
                   .CustomButton(cb => cb.Name("insertExternalLink").ToolTip("Insert Link").Exec("insertExternalLink"))
                    .CustomButton(cb => cb.Name("insertVideo").ToolTip("Insert Video").Exec("insertVideo"))
                    .InsertFile()
                  .SubScript()
                  .SuperScript()
                  .TableEditing()
                    .ViewHtml()
                   .CustomButton(c => c.Name("cleanFormatting").Exec("function() { this.exec('cleanFormatting'); }")
                )
 
                            .Formatting(formatting => formatting.Add("Paragraph", "p")
                                                   .Add("Heading 1", "h1")
                                                   .Add("Heading 2", "h2")
                                                   .Add("Image left", ".img-left")
                                                   .Add("Image right", ".img-right"))
                  .FontName()
                  .FontSize()
                   
                          .FontColor().BackColor()
                                           
                                            
                                         
                                          )
                                           .StyleSheets(css => css.Add(Url.Content("~/Content/editorStyles.css"))))



0
Alex Gyoshev
Telerik team
answered on 18 Jul 2014, 10:46 AM
Hello Mark,

I am sorry, the proper code is 

        .CustomButton(c => c
             .Name("cleanFormatting")
             .Exec("function(e) { e.sender.exec('cleanFormatting'); }")
        )

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Mark
Top achievements
Rank 1
answered on 21 Jul 2014, 07:53 AM
Hi Alex,

thank you for your answer, but unfortunately e.sender is undefined.
Do you already have a date for the next internal release because this button is nice to have but isn't that urgent for us, so we can wait for a clean release.

Thank you very much.
Best regards
Mark
0
Alex Gyoshev
Telerik team
answered on 21 Jul 2014, 08:21 AM
Hello Mark,

The latest internal build from last week includes the fix.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Editor
Asked by
Mark
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Mark
Top achievements
Rank 1
Share this question
or