GridMvc分页在“模式”弹出窗口中不起作用

时间:2019-03-14 11:01:00

标签: asp.net-mvc grid.mvc

在我的项目中  我用网格创建了弹出模式。我尝试单击网格页面按钮,但是它不起作用。

模式代码:

<div id="search" class="modal fade" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header" style="border-radius: 0.3rem;">
                @Html.Label("General Search", new { @class = "model-title" })
                <button type="button" id="btnclose" class="close" data-dismiss="modal">x</button>
            </div>
            <div class="card-body" style="margin:2%">
                <div class="card-header">
                    @Html.Label("Search Details", new { @class = "card-title" })
                </div>
                <div class="row" style="margin-top:1%;">
                    <div class="col-sm-2">
                        @Html.LabelFor(m => m.Search_Field, new { @class = "control-label form-control-sm" })
                    </div>
                    <div class="col-sm-4">
                        @Html.DropDownListFor(m => m.Search_Field, ((List<SelectListItem>)ViewBag.Search).Select(m => new SelectListItem { Text = m.Text, Value = m.Value })
                       , new { @class = "form-control form-control-sm",@id="cmbProductField" })
                    </div>
                    <div class="col-sm-2">
                        @Html.LabelFor(m => m.Search_Value, new { @class = "control-label form-control-sm" })
                    </div>
                    <div class="col-sm-4">
                        @Html.TextBoxFor(m => m.Search_Value, new { @class = "form-control form-control-sm", @id = "txtProductValue" })
                    </div>
                </div>
                <div class="col-sm-12 text-center" style="margin-top:2%;">
                    <button type="button" id="btnProductSearch" class="btn btn-success" style="width:100px"><i class="fas fa-search"></i> Search</button>
                </div>

                <div id="Productgrid" class="col-sm-12 table-responsive" style="width:100%;height:300px;margin-top:3%;padding-left:0px;padding-right:0px;">
                    @{Html.Partial("ResultGrid", new List<SCM_MVC.Models.Search>(), new ViewDataDictionary(this.ViewData) { { "xForm", ViewData["FormName"] } }); }
                </div>
                <div class="form-actions" style="margin-top:2%;padding-left:2%;">
                    <button type="button" class="btn btn-success btn-sm" id="btnProductok" style="width:100px" data-dismiss="modal"><i class="fas fa-check"></i> OK </button>
                </div>
            </div>
        </div>
    </div>
</div>

网格代码:

@model IEnumerable<SCM_MVC.Models.Search>
@using GridMvc.Html;

@{
    if (Model != null)
    {
       <div class="table-responsive">
                 @Html.Grid(Model).Columns(columns =>
            {
                columns.Add()
                .Encoded(false)
                .Sanitized(false)
                .SetWidth(10)
                .RenderValueAs(o => new HtmlString
                (
                  "<input id='hiddenValue' type='hidden' class='check' value='" + o.select + "'/>" +
                  "<input type='checkbox' class='check' value=" + o.select + "/>"
                ));
                columns.Add(c => c.product_code).Titled(Resources.Resource.product_id);
                columns.Add(c => c.product_name).Titled(Resources.Resource.product_name);
                columns.Add(c => c.unit).Titled(Resources.Resource.unit);
                columns.Add(c => c.mrp).Titled(Resources.Resource.mrp);
                columns.Add(c => c.tax).Titled(Resources.Resource.tax);
            }).WithPaging(10).Sortable(true).EmptyText("No data found").Named("GridSearch").Filterable(true)
             </div>
    }
    else
    {
        <label>No Data Found</label>
    }
}

如何进行网格分页?

0 个答案:

没有答案