2017-01-18 3 views
0

Webgridのページネーションをブートストラップでスタイルしたいけど、良い方法は見つけられません。webgridでブートストラップのページ設定を実装する

このパッケージが見つかりました。https://www.nuget.org/packages/WebGridBootstrapPagination/ ですが、インストール後に使用することはできません。あなたは、パッケージを使用するか、私に知らせてください、他の方法を知っている方法を知っている場合はここ

は私のWebGrid

@model IEnumerable<AnalyticConfig.Models.User> 
@{ 
    var grid = new WebGrid(Model, ajaxUpdateContainerId: "ajaxgrid", ajaxUpdateCallback: "webgrid", rowsPerPage: 5); 
    grid.Pager(WebGridPagerModes.All); 
} 


    <div id="ajaxgrid" class="row panel-body table-responsive"> 
    @grid.GetHtml(
    tableStyle: "table table-striped table-list table-hover", 
    columns: grid.Columns(
       grid.Column(canSort: false, style: "col-md-2", format: 
       @<text> 
        <a href='#' class="btn btn-info glyphicon glyphicon-pencil display edit-btn"></a> 
        <a href="#" class="btn btn-success glyphicon glyphicon-ok modify save-btn"></a> 
        <a href="#" class="btn btn-warning glyphicon glyphicon-remove modify cancel-btn"></a> 
        <a href="#" class="btn btn-danger glyphicon glyphicon-trash display delete-btn"></a> 
       </text>), 
       grid.Column(null, null, style:"hidecol", format: @<input type="hidden" id="in_ID" value="@item.Id" />), 
       grid.Column("SchoolUnit", "Skolenhet", style: "col-md-2", format: 
       @<text> 
        <span class="display"><label id="lbl_unit">@item.SchoolUnit</label></span> 
        @Html.DropDownList("in_unit", new SelectList(ViewBag.schoolUnitList, "Text", "Value", @item.SchoolUnit), new { @class = "form-control modify" }) 
       </text>), 
       grid.Column("Name", "Namn", style: "col-md-2", format: 
       @<text> 
        <span class="display"><label id="lbl_name">@item.Name</label></span> 
        <input type="text" id="in_name" value="@item.Name" class="form-control modify" /> 
       </text>) 

    ) 
    </div> 

の一部です。

答えて

2

私の解決策。いいえカスタムCSSやHTMLは

$("tfoot a").addClass('btn btn-default'); // add bootstrap buttons 

// add active bootstrap button 
$("tfoot td") 
    .contents() 
    .filter(function() {  
     if (this.nodeType === 3 && this.length > 1) { 
      return this.nodeType 
     } 
    }) 
    .wrap('<span class="btn btn-primary" />'); 

結果 enter image description here

WebGridのページネーションのために追加されません
関連する問題