0
votes

I have the following parameterMap property for a Kendo UI grid. I would like to pass additional data that tells the data type of each column in grid. How would I do this?

parameterMap: function (data, operation) {
                            if (operation != "read") {
                                // web service method parameters need to be send as JSON. The Create, Update and Destroy methods have a "products" parameter.
                                return JSON.stringify({ products: data.models })
                            } else {
                                // web services need default values for every parameter
                                data = $.extend({ sort: null, filter: null }, data);
                                return JSON.stringify(data);
                            }
                        }
1

1 Answers

1
votes

You can just add this data to the object you are going to return.

 data = $.extend({ sort: null, filter: null }, data);

 data = $.extend(data, { 
   columns: [
     { name: "foo", type: "string" },
     { name: "bar", type: "number" }
   ]
 });

 return JSON.stringify(data);