2
votes

I am using Kendo UI for a long while (months ago) and I built web app prototypes. Usually I use "serverSorting" and "serverFiltering" options to "true" as I do theses operations on my servers.

This worked fine until I began using KendoUI's last version (I am using kendo_2013.2.716 and jquery-1.9.1.min.js). Since that moment I realized Kendo Datasource or Grid (through Datasource, I guessed) wasn't sending field "field" in "sort object". Before now it was sending object containing { dir = 'asc', field = 'id'}, p.e., but now it is sending { dir = 'asc', compare : null }

Also, when I debug var "options" in  
parameterMap: function(options, operation)  I see it isn't containing "field" which I am trying to sort by (I attach a screenshot about "options" containing)

Also, when ServerFiltering is true, I noticed field "field" in avoid and removed from array and don't sent to server, so I must use another variable name as "myfield" or whatever.  
 Is this problem familiar to you?



Thanks for your attention.



Kind Regards.

I would like add I tested adding option

sort: [ { field: 'id', dir: 'asc' } ]

in Datasource. This is sent to serverside accurately, but it seems KendoGrid does something wrong when it sends field name (in fact, it doesn't send it) in order to change sort options in DataSource.

2
The screen shot is missing?OnaBai
Sorry, OnaBai, I have no reputation for posting images, but, basically it was a screenshot from Firebug showing sort object without "field" field. I write down in text: { dir="asc", compare=null} instead of { field='date1', dir="asc" } as it was working in previous version.leumasino
I tested it with the latest release and I get field sent. Some suggestions... try removing your parameterMap and check what firebug says that you are sending, define transport read as get and most important define in your grid sortable as true. Are you able of reproducing it in JSFiddel / JSBin? If you include your grid and datasource definition I might try reproducing it.OnaBai
Thanks, OnaBai. I tested your suggestions and it remains same. I am unable to post whole code because it has got too many dependencies and I can not extract this part only. Anyway, as you confirmed sorting works in new version, you helped me very much. I will rebuild datasource and grid definition and try again.leumasino
Well, I finally found and fixed it. Datasource has not explicitly defined names for fields in "schema['model']" array. This didn't seem necessary before (p.e kendo v2012.1.515). Thanks Onabai for clues.leumasino

2 Answers

0
votes

Try this in grid definition

sortable: { mode: "single", allowUnsort: false }