This is a migrated thread and some comments may be shown as answers.

Non standard AJAX data

2 Answers 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 03 Jan 2012, 10:55 PM
When working on the grid tool for Kendo UI and ColdFusion it passes the paging and common request data as expected. There is other data that comes back as string values and it doesn't get broken up. Perhaps this is because the results are in brackets with text that should perhaps be in quotes. Has anyone had problems with this on other platforms?

method:  getRegistrations
take:  5
skip:  5
page:  2
pageSize:  5
sort[0][field]:  institution_main
sort[0][dir]:   desc
filter[filters][0][logic]:  or
filter[filters][0][filters][0][field]:  institution_main
filter[filters][0][filters][0][operator]:  eq
filter[filters][0][filters][0][value]:  2
filter[filters][0][filters][1][field]:  institution_main
filter[filters][0][filters][1][operator]:  eq
filter[filters][0][filters][1][value]:  4
filter[filters][1][field]:  institution_id
filter[filters][1][operator]:  contains
filter[filters][1][value]:  3
filter[logic]:  and

 As you can see most of the fields are properly formatted. The sort field just doesn't come over right. The filter fields get even worse.

It seems like this should be 
sort[0]['dir']:   desc 
vs
sort[0][dir]:   desc 

There is a great open source library that can process this if the field names in brackets are delivered in quotes.

2 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 03 Jan 2012, 11:36 PM
Tried that BTW... wish it would just send back standard JSON. Is that possible?
0
John
Top achievements
Rank 1
answered on 04 Jan 2012, 10:22 PM
Wrote a translation in CF that takes care of this. It would still be optimal if a JSON package came back vs this odd variable naming convention.
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Share this question
or