簡體   English   中英

jQuery Bootgrid渲染,最后一列中的值重復

[英]jquery bootgrid rendering with value in Last Column Repeated

我有一個簡單的表,我綁定了這個jquery引導網格。 但是Cloumn中的最后一個值會反映到該行的所有列中。 如果我取消綁定make網格,這剛剛發生。

相同的代碼包含在下面。 任何的意見都將會有幫助。

     @Section Scripts
     <script src="~/Scripts/jquery.bootgrid.js"></script>
<script>

      $(document).ready(function () {
        $("table.make-bootgrid").bootgrid();
    });
</script>
        End Section


 <div class="panel panel-primary">
<div class="panel-heading">
   <h3 class="panel-title">
        All Requests for Service
    </h3>
</div>
<div class="table-responsive">
    <table class="table table-striped table-hover make-bootgrid">
        <thead>
            <tr>
                <th>

                </th>
                <th>
                    Car Registeration
                </th>
                <th>
                    Services In Request
                </th>
                <th>
                    Services In Request Count
                </th>
                <th>
                    Quotes Count
                </th>
                <th>
                    Created
                </th>

            </tr>
        </thead>
        <tbody>
            @For Each item In Model
                Dim itemValue = item
                @<tr>
                    <td>
                        @Html.ActionLink("View", "Details", "Requests", New With {.id = itemValue.ID}, Nothing)
                    </td>
                    <td>
                        @Html.DisplayFor(Function(modelItem) itemValue.Registration)
                    </td>
                    <td>
                        @For Each sir As ServicesInRequest In itemValue.ServicesInRequests
                            @<li>@sir.Service.Name</li>
                        Next
                    </td>
                    <td>
                        @Html.DisplayFor(Function(modelItem) itemValue.ServicesInRequests.Count)
                    </td>
                    <td>
                        @Html.DisplayFor(Function(modelItem) itemValue.Quotes.Count)
                    </td>
                    <td>
                        @Html.DisplayFor(Function(modelItem) itemValue.Created)
                    </td>
                </tr>
            Next
        </tbody>
    </table>
</div>

我有同樣的問題。 通過以下方式解決了此問題:

  • 確保您將一列指定為:data-identifier =“ true”
  • 確保所有列都具有數據ID屬性:data-column-id =“ GroupID”

請參閱以下工作表摘錄:

    <thead>
        <tr class="active">
            <th data-column-id="GroupID" data-identifier="true" data-type="numeric">ID</th>
            <th data-column-id="GroupName" data-order="asc">Name</th>
            <th data-column-id="GroupDesc">Description</th>
        </tr>
    </thead>  

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM