Tabstrip Razor Issue.

4 posts, 0 answers
  1. Rene
    Rene avatar
    65 posts
    Member since:
    Nov 2010

    Posted 11 Feb 2013 Link to this post

    I get an invalid template when using tabstrips in the following scenario:

    grid -> popup edit - popup has a grid - this grid has a popup for edit - and that popup has a tabstrip.

    I believe it is caused the by the hashtag on the href below for the tabs.

    <a class="k-link" href="#choiceDetailTabstrip-2">HTML Fragment</a>

    Please advise.

    Thanks.

    Rene.

    Edit:  It may also be due to jQuery("#choiceDetailTabstrip").kendoTabStrip( ..

    The hash tags are not escaped ... as well - I also have a Kendo editor in one of the tabs...
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 12 Feb 2013 Link to this post

    Hello Rene,

    If you want to use a Kendo Widget as a template, you should call the ToClientTemplate method when initializing it to have the hash symbols escaped.
    E.g.

    @(Html.Kendo().TabStrip()
        .Name("tabstrip")
        .ToClientTemplate()
    )

      Regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Rene
    Rene avatar
    65 posts
    Member since:
    Nov 2010

    Posted 12 Feb 2013 Link to this post

    Thanks Dimiter!

    This is probably unrelated, but the editor shows the actual HTML code instead of rendered HTML in the editor?
    Such as:

    <p>Hello World!</p><p></p><p>Good <strong><span style="font-size:x-large;background-color:#ed1c24;">DAY!</span></strong></p>

    As well - when I hover over the toolbar buttons in the editor - the same image (text justification icon) appears over any of the buttons on hover...

    The above occurs in both IE and FF.

    Update:  Forget the html rendering.  I forgot to do something I have to do with these edit fields...... (using EF DB First).

    In my onsave event, assume that I have an editor field with name "USER_NOTE", I do the following:

    // client side (grid onsave - edit popup)
    function onSaveuserNotes(ev) {
    // yes, i could have combined lines, but did it for clarity.   
     
      var uNote = $("#USER_NOTE").data("kendoEditor").value();
      var uNote64 = encodeURIComponent(Base64.encode(uNote));
      $("#USER_NOTE").val(uNote64);
      ev.model.USER_NOTE = uNote64;

      return true;
    }

    // Controller
    // HTML Editor Fields

    // Create or Save method in controller - relevant lines.

    // other code here

    string actualNote =  Utilities.DecodeFromBase64( HttpUtility.UrlDecode(collection["USER_NOTE"]).Replace(' ','+'),"UTF8");
    o.USER_NOTE = actualNote;

    dbUser.Users.SaveChanges();

     

    The above works like a charm using EF 4.x DB first and MVC.  ( I carried that over from when I was using Telerik MVC and had problems with editor fields from client to controller).
  5. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 14 Feb 2013 Link to this post

    Hi Rene,

    In order to fix the strange behavior when hovering the editor toolbar buttons, please update to the latest internal build of Kendo UI. Let me know if you have further issues.

     

    Kind regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready