首页 新闻 会员 周边

telerik的grid分页导航问题。

0
悬赏园豆:10 [已解决问题] 解决于 2014-08-26 09:22

当我使用分页功能的时候,出现了问题:

下面的是正常的:

 

        public ActionResult MyCustomer(CustomerSearchModel model)
        {
            this.InitCustomerList("我的客户", model.GradeId.HasValue ? "MyCustomer" : null, model.GradeId);
            model = this.InitCustomerSearchModel(model);
            model.RouteName = "MyCustomer";
            model.IsDept = false;
            model.CanAssignTo = true;
            model.ShowGradeValues = !model.GradeId.HasValue;
            model.SelectModularType = ModularType.Customer;
            if (model.GradeId.HasValue)
            {
                model.SelectedGradeValue = model.GradeId.Value;
            }
            //model.ViewName = "MyCustomerList";
            model.ForPublic = false;
            //model.GridCommand = null;
            return View("MyCustomerList", this.RunListPage(model, null));
        }

MyCustomerList.cshtml:

@model CustomerSearchModel
<div style="width:95%;padding-left:20px;">
    @Html.Partial("_CustomerFilterList", Model)
</div>

_CustomerFilterList.cshtml:

@model CustomerSearchModel
@{
    Layout = null;
@using (Html.BeginRouteForm(Model.RouteName, new { gradeId = Model.GradeId }, FormMethod.Get, new { Id = "SearchForm" }))
{
<div>
    @Html.Partial(Model.FilterViewName ?? "_CustomerFilterView", Model)
</div>
<div style="margin-bottom:50px">
    @Html.Partial(Model.ListViewName ?? "_CustomerListView", Model)
</div>
}

页码导航能使用MyCustomerList这个Action路径。

而下面的代码则出现错误,页码导航使用了CustomerList作为Action路径:

        public ActionResult MyCustomer(CustomerSearchModel model)
        {
            this.InitCustomerList("我的客户", model.GradeId.HasValue ? "MyCustomer" : null, model.GradeId);
            model = this.InitCustomerSearchModel(model);
            model.RouteName = "MyCustomer";
            model.IsDept = false;
            model.CanAssignTo = true;
            model.ShowGradeValues = !model.GradeId.HasValue;
            model.SelectModularType = ModularType.Customer;
            if (model.GradeId.HasValue)
            {
                model.SelectedGradeValue = model.GradeId.Value;
            }
            //model.ViewName = "MyCustomerList";
            model.ForPublic = false;
            //model.GridCommand = null;
            return View("MyCustomerList", model);// this.RunListPage(model, null));
        }
        [ChildActionOnly]
        public ActionResult CustomerList(CustomerSearchModel model)
        {
            model = this.RunListPage(model, model.GridCommand);
            if(model.ViewName == null)
            {
                model.ViewName = "_CustomerFilterList";
            }
            if(model.ListViewName == null)
            {
                model.ListViewName = "_CustomerListView";
            }
            if(model.FilterViewName == null)
            {
                model.FilterViewName = "_CustomerFilterView";
            }
            return View(model.ViewName, model);
        }

MyCustomerList.cshtml:

@model CustomerSearchModel
<div style="width:95%;padding-left:20px;">
    @Html.Action("CustomerList", "Customer", Model)
</div>
519740105的主页 519740105 | 大侠五级 | 园豆:5810
提问于:2014-07-31 17:45
< >
分享
最佳答案
0

没办法解决,只能通过切换回原来的环境或虚拟一个环境来达成目的。

519740105 | 大侠五级 |园豆:5810 | 2014-08-26 09:22
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册