Keith Doran
Keith Doran

Reputation: 464

KendoUi MVC Grid passing parameter values

I am trying to pass a parameter value through to my controller method with no success. The parameter value is coming through as null.

View Code:

 <div class="col-md-9">
        @(Html.Kendo().Grid(Model)
        .Name("ProcessesGrid")
        .DataSource(datasource =>
        datasource
        .Ajax()
                .Read(read => read.Action("ListProcesses", "Process").Data("additionalData"))))
        <script>
            function additionalData() {
                //alert('Hitting javascript')
                return {
                    testParam: 2
                };
            }
        </script>

Controller Method:

[HttpPost]
    public ActionResult ListProcesses([DataSourceRequest]DataSourceRequest request, int? testParam)

Upvotes: 0

Views: 4972

Answers (1)

pwdst
pwdst

Reputation: 13755

Which version of Kendo UI are you using? There was a bug in 2013.3.1316 which meant parameters from JavaScript functions are not sent with the request. This sounds exactly like your issue. The issue was with the kendo.aspnetmvc.js file. This was fixed in the internal build 2013.3.1321 and subsequent release 2013.3.1324 - both of these should be available to download in your My Account area.

Upvotes: 0

Related Questions