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

Tabstrip Razor Issue.

3 Answers 168 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Rene
Top achievements
Rank 1
Rene asked on 11 Feb 2013, 10:43 PM
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...

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 12 Feb 2013, 05:23 PM
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!
0
Rene
Top achievements
Rank 1
answered on 12 Feb 2013, 07:42 PM
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).
0
Dimiter Madjarov
Telerik team
answered on 14 Feb 2013, 01:25 PM
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!
Tags
TabStrip
Asked by
Rene
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Rene
Top achievements
Rank 1
Share this question
or