Hi,
I have the following code which is far as I can tell as per the documentation and examples but the listview always appears empty.
My View is as follows
And my controller contains
And myLocation is
Now, with this implementation my controller function getRoles is hit and I can see the data returned from the server via browser tools as below.
Data returned from server
{"Data":[{"Id":132,"Description":"Location 1"},{"Id":133,"Description":"Location 2"},{"Id":134,"Description":"Location 3"},{"Id":135,"Description":"Location 4"}],"Total":4,"AggregateResults":null,"Errors":null}
The change function on the datasource is then subsequently hit but the data parameter returned contains an empty set of Data items as below (taken from visual studio immediate window).
If I change my controller to return without using the ToDataSourceResult extension it actually will work.
return Json(Locations);
However, is this then the correct implementation or have I done something else wrong? And would this have an effect on how paging works?
Any help would be much appreciated.
Thanks