2010-12-09 35 views
0

我有一个网格,并在详细视图我使用的是一个标签条,每个标签条包含一个网格。问题是,当点击标签时,没有任何反应。我使用的是2010.3.1110版本,并且已经更新了所有的jquery。Tabstrip内网格不工作

这里是我的Site.Master

<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head id="Head1" runat="server"> 
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title> 
<link href="../../Content/Styles/Site.css?v=<%=DateTime.Now%>" rel="stylesheet" type="text/css" /> 
<script src="../../Scripts/2010.3.1110/jquery-1.4.3.min.js" type="text/javascript"></script> 
<%= 
      Html.Telerik().StyleSheetRegistrar() 
       .DefaultGroup(group => group.DefaultPath("~/Content/2010.3.1110/") 
              .Add("telerik.common.min.css") 
              .Add("telerik.iks.min.css")) 
%> 
<script type="text/javascript"> 
    $(function() { 
     $.fn.loadSelect = function (data) { 
      return this.each(function() { 
       this.options.length = 0; 
       var select = this; 
       $.each(data, function (index, itemData) { 
        var option = $('<option value="' + itemData.Value + '">' + 
           itemData.Text + '</option>'); 
        $(select).append(option); 
       }); 
      }); 
     }; 
    }); 

    function submitform() { 
     document.myform.submit(); 
    } 

    //do all this when the dom is loaded 
    $(function() { 
     //get all delete links (note the class i gave them in the html) 
     $("a.delete-link").click(function() { 
      //basically, if confirm is true (ok button is pressed), then 
      //the click event is permitted to continue, and the link will 
      //be followed - however, if the cancel is pressed, the click event will be stopped here 
      return confirm("Are you sure you want to delete this?"); 
     }); 
    }); 

    //do all this when the dom is loaded 
    $(function() { 
     //get all delete links (note the class i gave them in the html) 
     $("a.save-before-link").click(function() { 
      //basically, if confirm is true (ok button is pressed), then 
      //the click event is permitted to continue, and the link will 
      //be followed - however, if the cancel is pressed, the click event will be stopped here 
      return confirm("Did you save before clicking this link?"); 
     }); 
    }); 

</script> 
<asp:ContentPlaceHolder ID="ScriptContent" runat="server" /> 

<div id="wrap"> 

     <div id="main" class="clearfix"> 

      <div id="header"> 
       <asp:ContentPlaceHolder ID="HeaderContent" runat="server" /> 
      </div> 

      <div id="sidebar"> 
       <asp:ContentPlaceHolder ID="SideBarContent" runat="server" /> 
      </div> 

      <div id="content"> 
       <asp:ContentPlaceHolder ID="MainContent" runat="server" /> 
      </div> 

     </div> 

    </div> 

     <div id="footer"> 
      <% 
       Html.RenderPartial("SiteMasterFooter");%> 
      <div style="clear: both;"><!-- --></div> 
     </div> 

     <div style="clear: both;"><!-- --></div> 

     <%Html.Telerik().ScriptRegistrar().DefaultGroup(asset => asset.DefaultPath("~/Scripts/2010.3.1110") 
             .Add("jquery-1.4.3.min.js") 
             .Add("telerik.common.min.js") 
             .Add("telerik.examples.min.js") 
             .Add("jquery.validate.min.js") 
             .Add("telerik.panelbar.min.js")) 
         .Render();%> 
</body> 

这里是我的网

Html.Telerik().Grid(Model) 
     .Name("InvoiceDataGrid2") 
     .Columns(columns => 
        { 
         columns.Bound(s => s.Company.CompanyName) 
          .Title("Company Name"); 
         columns.Bound(s => s.ManifestCount) 
          .Title("# of Manifests"); 
         columns.Bound(s => s.ManifestTimeCount) 
          .Title("Manifest Time"); 
         columns.Bound(s => s.FieldOfficeTimeCount) 
          .Title("Office Time"); 
        }) 
     .DetailView(details => details.Template(e => 
        { 
         %> 
         <% 
          Html.Telerik().TabStrip().Name("tabstrip_test_" + e.Company.CompanyName) 
          .Items(items => 
             { 
              items.Add().Text("Blah 1").Content(() => 
                        { 
                         %> 
                         Blah blah blah 
                         <% 
                        }); 
              items.Add().Text("Blah 2").Content(() => 
                        { 
                         %> 
                         Blah blah blah 
                         <% 
                        }); 
             }) 
             .Render(); 
         %> 
         <% 
        })) 
     .Pageable(paging => paging.PageSize(5)) 
     .Sortable() 
     .Render(); 
%> 

林基本上是复制你的演示REG arding server detail binding,http://demos.telerik.com/aspnet-mvc/grid/detailsserverside但它只是不想工作。我已经确定使用telerik.validate.min.js v1.7并添加了telerik.common.min.js,但再次,它不工作。我需要尽快帮助

回答

0

好吧,所以我这是一个愚蠢的问题。它不工作的原因是因为我动态设置的名称中有一个空格。当我把它的名称设置为项目的ID而不是名称时,它工作正常。