2010-12-09 4 views
0

J'ai une grille, et sur la vue de détail j'utilise une bande d'onglet, chaque bande d'onglet contient une grille. Le problème est que lorsque vous cliquez sur les onglets, rien ne se passe. J'utilise la version 2010.3.1110, et j'ai mis à jour tous les jquery.La bande d'une grille ne fonctionne pas

Voici mon 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> 

Et voici ma grille

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(); 
%> 

Im copie essentiellement votre reg de démonstration la liaison de détail de serveur d'arding, http://demos.telerik.com/aspnet-mvc/grid/detailsserverside mais elle ne veut juste pas travailler. J'ai fait en sorte d'utiliser im telerik.validate.min.js v1.7 et d'ajouter dans telerik.common.min.js mais encore une fois, cela ne fonctionne pas. J'ai besoin d'aide dès que possible

Répondre

0

OK, donc c'était un problème stupide. La raison pour laquelle ça ne fonctionnait pas était parce que le nom que je mettais dynamiquement, avait un espace dedans. Quand je l'ai mis le nom pour avoir l'identification de l'article par opposition au nom, cela a fonctionné très bien.

Questions connexes