ASP.NET MVC server wrapper for CleanFormatting missing

7 posts, 0 answers
  1. Mark
    Mark avatar
    14 posts
    Member since:
    Jul 2013

    Posted 17 Jul 2014 Link to this post

    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
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 17 Jul 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Mark
    Mark avatar
    14 posts
    Member since:
    Jul 2013

    Posted 17 Jul 2014 in reply to Alex Gyoshev Link to this post

    This worked.

    Thank you very much

    Best regards
    Mark
  5. Mark
    Mark avatar
    14 posts
    Member since:
    Jul 2013

    Posted 18 Jul 2014 Link to this post

    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"))))



  6. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 18 Jul 2014 Link to this post

    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!
     
  7. Mark
    Mark avatar
    14 posts
    Member since:
    Jul 2013

    Posted 21 Jul 2014 in reply to Alex Gyoshev Link to this post

    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
  8. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 21 Jul 2014 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready