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

Tabstrip ClientDetail template Invalid template

3 Answers 103 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
reynaldo
Top achievements
Rank 1
reynaldo asked on 05 Jun 2013, 11:23 AM
Im having a problem rendering a detail template which is compose of Kendo Tabstrip. It generates an "Invalid Template" error. Below is my code

@(Html.Kendo().Grid<OrderInfo>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(e => e.OrderID);
        columns.Bound(e => e.MaterialID);
    })
    .Sortable()
    .Pageable()
    .Scrollable()
    .ClientDetailTemplateId("drawingtemplate")
    .DataSource(dataSource => dataSource
            .Ajax()
            .Read(read => read.Action("ReadOrders","Admin"))
       )
   .Events(events => events.DataBound("dataBound"))
 )
<script>
    function dataBound() {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    }
</script>
<script id="drawingtemplate" type="text/kendo-tmpl">   
    @(Html.Kendo().TabStrip()
        .Name("my#=OrderID#")
        .SelectedIndex(0)
        .Animation(animation => animation.Open(open => open.Fade(FadeDirection.In)))        
        .Items(items =>
          {
              items.Add().Text("FirstTab")
                  .Selected(true)
                  .Content("try");
          })
          .ToClientTemplate()       
          )
@(Html.Kendo().NumericTextBox<double>()
            .Name("my#=OrderID#")
            .Format("p0")
            .Min(0)
            .Max(0.9)
            .Step(0.01)
            .Value(0.05)
            .ToClientTemplate()
        )
</script>

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 07 Jun 2013, 07:09 AM
Hi Reynaldo,


The provided code seems correct. The only issue that I found, which is not related to the template error is that the two widgets TabStrip and NumericTextBox will have identical names, so please rename one of them.

I am assuming that the error is caused by the AntiXss encoder. Please remove the following line from your Web.config file if it is present.

E.g.
<httpRuntime targetFramework="4.5" encoderType="System.Web.Security.AntiXss.AntiXssEncoder, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

 
I hope that this information was helpful for you. I wish you a great day!

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
reynaldo
Top achievements
Rank 1
answered on 11 Jun 2013, 04:41 AM
hi dimiter,

         the numeric textbox was originally commented out, it is really included in the code.

         when i deleted the line in the web config it produces another error in the code produce by the kendo like the following

e=kendo.htmlEncode;with(data){o='<tr class="k-detail-row"><td class="k-hierarchy-cell"></td><td class="k-detail-cell" colspan="5">'+(this.tmpl0(data))+'</td></tr>';}return o;
the error is:
Object expected

If there is a handler for this exception, the program may be safely continued
0
Dimiter Madjarov
Telerik team
answered on 11 Jun 2013, 10:05 AM
Hi Reynaldo,


This is a very generic JavaScript error and I could not be sure what exactly is causing the issue. If it is convenient, could you please send me a sample runnable project, which I could inspect locally and assist you further?

I am looking forward to hearing from you.

 

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