Kendo Ui Grid not rebinding after search button click

前端 未结 1 1638
情歌与酒
情歌与酒 2021-01-15 16:16

I having difficulty where the Kendo Ui grid would not rebind with new result after the Search button click.Please let me know how i could achieve this. Thank you

Cur

1条回答
  •  终归单人心
    2021-01-15 16:33

    Try like this,

    In your grid read method in view like this

      .Read(read => read.Action("GetData", "Details").Data("GetData"))
    

    You button should be Submit Type

      
    

    Script

     function GetData() {
        return {
    HRN: $('#HRN').val(),
    FamilyName: $('#FamilyName').val(),
    GivenName: $('#GivenName').val(),
    Priority: $('#Priority').val()
    
        };
    }
    
    
    
    $(document).ready(function () {
      $("#btnSearch").click(function (e) {
                $("#Result").data("kendoGrid").dataSource.read();
                $("#Result").data("kendoGrid").refresh();
                e.preventDefault();
            });
    });
    

    Controller

    public ActionResult GetData([DataSourceRequest] DataSourceRequest request,  string HRN, string FamilyName, string GivenName, string Priority)
            {
                DataTable result = GetList(HRN,FamilyName,GivenName,Priority);
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                return Json(result.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
            }
    

    0 讨论(0)
提交回复
热议问题