Errors loading data

Errors loading data

bweberbweber Posts: 2Questions: 0Answers: 0
edited July 2013 in General
I am having issues getting my datatable to load my JSON from the server i am using, i believe that it is because i don't have a title for the JSON, but i'm not sure how to get around it as there isn't an easy way for me to add a title to the JSON code. Below is the JavaScript
[code]require.config({ baseUrl: "/assets/iids/js/" });
require( ['jquery','ge/datatables'], function($) {
$(function () {
$('#servertable').dataTable( {
"bServerSide": false,
"bProcessing": true,
"sAjaxSource": "",
"aoColumns": [
{ "mData": "rate_id" },
{ "mData": "rate_label" },
{ "mData": "yearly_rate" }
],
"sAjaxDataProp": "",
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.ajax( {
"crossDomain": true,
"dataType": 'jsonp',
"type": "GET",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
}
} );
});
});
[/code]
and here is the JSON i'm attempting to use
[{"rate_id":1,"rate_label":"GE-MKE","yearly_rate":168251},{"rate_id":2,"rate_label":"GE-BLR","yearly_rate":46738},{"rate_id":3,"rate_label":"GE-HUN","yearly_rate":122699},{"rate_id":4,"rate_label":"PS-MKE","yearly_rate":140000},{"rate_id":5,"rate_label":"PS-BLR","yearly_rate":46140},{"rate_id":6,"rate_label":"Test","yearly_rate":5},{"rate_id":7,"rate_label":"test2","yearly_rate":10},{"rate_id":8,"rate_label":"GE-SRM","yearly_rate":123456},{"rate_id":9,"rate_label":"dsp-test","yearly_rate":654321}]

Replies

  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    Looks like it should probably work. Please link to a test case showing the issue: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Allan
  • bweberbweber Posts: 2Questions: 0Answers: 0
    we realized our issue was in the proxy and have resolved said issue using an in-house proxy. but thanks for your response.
This discussion has been closed.