2013-02-24 65 views
0

我想在頁面上使用columnfilter。在一個頁面上,這個過濾工作可以完成,但是在這個頁面上它沒有。我試着從這樣的作品,我試圖從腳本列表中拖動到頁面,但仍然沒有在網頁coppying相同的腳本的URL。爲什麼我的columnfilter不能過濾?

注:該頁面有搜索頁眉和頁腳字段和它的反應,當我把搜索文本中,但它沒有返回。我得到:「顯示0條目的0到0(從10條總條目中篩選)」...每一次。

我能怎麼做錯誤或丟失?感謝您的任何幫助與這一個>

<link href="../../Content/dataTable/the_table.css" rel="Stylesheet" type="text/css" /> 
    <script src="../../Scripts/DataTables-1.9.1/media/js/jquery.dataTables.js" type ="text/javascript"></script> 
    <script src="../../Scripts/jquery.dataTables.columnFilter.js" type ="text/javascript"></script> 
    <script src="../../Scripts/jquery.ui.datepicker.js" type="text/javascript"></script> 

    <script type="text/javascript"> 
    $(document).ready(function() { 
     $(".datefield").datepicker(); 
     $("#history").dataTable().focus().columnFilter({ 
      aoColumns: [null, { type: "text" },null , null, null, null] 
     }); 
    }); 
    </script> 

    <br /><br /> 

    @Html.ActionLink("Select", "ClassAttendance", "Attendance", new { rows = Model.Enrollments.Count(), id = @ViewBag.ID, teacher = HttpContext.Current.Session["sTeacher"], courseID = HttpContext.Current.Session["sCourseID"] }, null) 

    <p></p> 

    @using (Html.BeginForm("ClassAttendance", "Attendance", new { rows = Model.Enrollments.Count(), id = @ViewBag.ID, sTeacher = @ViewBag.teacherName, courseID = HttpContext.Current.Session["sCourseID"] }, FormMethod.Post)) 

    { 

    var attend = new Enrollment(); 
    @Html.ValidationSummary(true) 

    <p></p> 

    <h3>Students Enrolled in @ViewBag.teacherName's @ViewBag.courseTitle class</h3> 
    <div> 
     <table id=history> 
      <thead> 
      <tr> 
       <th>Reports</th> 
       <th>First Name</th> 
       <th>Last Name</th> 
       <th>Grade</th> 
       <th>Attendance Code</th> 
       <th>Class Day</th> 
      </tr> 
      </thead> 
      <tfoot> 
      <tr> 
       <td>Reports</td> 
       <td>First Name</td> 
       <td>Last Name</td> 
       <td>Grade</td> 
       <td>Attendance Code</td> 
       <td>Class Day</td> 
      </tr> 
      </tfoot> 
      <tbody> 
      @foreach (var item in Model.Enrollments) 
      {  
       @Html.HiddenFor(modelItem => item.EnrID)  
       @Html.HiddenFor(modelItem => item.Asgnt)<!--navigational--> 
       @Html.HiddenFor(modelItem => item. Title) 
       @Html.HiddenFor(modelItem => item.CouID) 
       @Html.HiddenFor(modelItem => item.Date) 
       @Html.HiddenFor(modelItem => item.dayOfWeek) 
       @Html.HiddenFor(modelItem => item.Actor) 
       @Html.HiddenFor(modelItem => item.SudIDD) 
       @Html.HiddenFor(modelItem => item. Address)        
       <tr> 
        <td> 
        @Html.ActionLink("Report", "PrintCustomers", "PdfRender", new { sName = item.Student.FirstMidName, courseTitle = item.Course.Title, sNumber = item.Student.StudentNum, instructorName = HttpContext.Current.Session["teacherName"] }, null) 
        </td> 
        <td> 
        @Html.EditorFor(modelItem => item.Student.FirstMidName) 
        </td> 
        <td> 
        @Html.EditorFor(modelItem => item.Student.LastName) 
        </td> 
        <td> 
        @Html.TextBoxFor(modelItem => item.HomeworkGrade) 
        @Html.ValidationMessageFor(model => model.Enrollments.FirstOrDefault().HomeworkGrade) 
        </td> 
        <td> 
        @Html.TextBoxFor(modelItem => item.attendanceCode) 
        @Html.ValidationMessageFor(model => model.Enrollments.FirstOrDefault().attendanceCode) 
        </td> 
        <td> 
        @Html.EditorFor(modelItem => item.classDays) 
        </td>  
       </tr>  
      } 
     </tbody> 
    </table> 
    </div> 
    <br /> 
    <Input Type ="submit" Value="Submit Attendance"/> 
    } 

回答

0

我最後通過具有它腳手架而不是複製一個視圖,粘貼的功能到另一個和調整重新創建視圖。我懷疑它可能有一些做沒有價值或僅僅擁有視圖導航性能的導航性能。請讓我知道你在想什麼。謝謝。

0

我不知道這是否導致你描述的問題,但你的表id沒有引用。

<table id=history>

<table id="history">

+0

我加了引號,但仍是同樣的問題...什麼都沒有發生。 – CloudyKooper 2013-02-25 00:42:47

相關問題