Trying to Get Some JSON Into Table - DataTables warning (table id = 'majors'): Requested unknown
Trying to Get Some JSON Into Table - DataTables warning (table id = 'majors'): Requested unknown
I'm new to DataTables, and am getting "DataTables warning (table id = 'majors'): Requested unknown parameter '0' from the data source for row 0" and am totally confused at the moment. Any and all help is appreciated!
My JSON:
[code]
{ "Records": [ {"ProgID":"11","ProgramName":"Pre-Engineering","DegreeType":"Pre","ProgramID":"109","MajorMinorID":"109"},
{"ProgID":"12","ProgramName":"Pre-Law","DegreeType":"Pre","ProgramID":"110","MajorMinorID":"110"}, {"ProgID":"13","ProgramName":"Special
Education","DegreeType":"Major","ProgramID":"134","MajorMinorID":"134"}, {"ProgID":"14","ProgramName":"Pre-
Optometry","DegreeType":"Pre","ProgramID":"0","MajorMinorID":"0"}, {"ProgID":"15","ProgramName":"Pre-
Pharmacy","DegreeType":"Pre","ProgramID":"0","MajorMinorID":"0"}, {"ProgID":"16","ProgramName":"Pre-Physical
Therapy","DegreeType":"Pre","ProgramID":"0","MajorMinorID":"0"}, {"ProgID":"17","ProgramName":"Pre-Physician
Assistant","DegreeType":"Pre","ProgramID":"159","MajorMinorID":"0"}, {"ProgID":"18","ProgramName":"Pre-
Seminary","DegreeType":"Pre","ProgramID":"0","MajorMinorID":"0"}, {"ProgID":"19","ProgramName":"Pre-
Veterinary","DegreeType":"Pre","ProgramID":"0","MajorMinorID":"0"}, {"ProgID":"20","ProgramName":"Pre-
Med","DegreeType":"Pre","ProgramID":"111","MajorMinorID":"111"} ]}
[/code]
My HTML:
[code]
$(document).ready(function() {
$('#example').dataTable( {
"iDisplayLength": 1,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "search.asp",
"aoColums": [
{"sName": "ProgID", "mDataProp": "ProgID"},
{"sName": "ProgramName", "mDataProp": "ProgramName" },
{"sName": "DegreeType", "mDataProp": "DegreeType" },
{"sName": "ProgramID", "mDataProp": "ProgramID" },
{"sName": "MajorMinorID", "mDataProp": "MajorMinorID" }
]
} );
} );
Entries in the Degree Table:
<!-- table goes here -->
ProgID
ProgramName
DegreeType
ProgramID
MajorMinorID
[/code]
My JSON:
[code]
{ "Records": [ {"ProgID":"11","ProgramName":"Pre-Engineering","DegreeType":"Pre","ProgramID":"109","MajorMinorID":"109"},
{"ProgID":"12","ProgramName":"Pre-Law","DegreeType":"Pre","ProgramID":"110","MajorMinorID":"110"}, {"ProgID":"13","ProgramName":"Special
Education","DegreeType":"Major","ProgramID":"134","MajorMinorID":"134"}, {"ProgID":"14","ProgramName":"Pre-
Optometry","DegreeType":"Pre","ProgramID":"0","MajorMinorID":"0"}, {"ProgID":"15","ProgramName":"Pre-
Pharmacy","DegreeType":"Pre","ProgramID":"0","MajorMinorID":"0"}, {"ProgID":"16","ProgramName":"Pre-Physical
Therapy","DegreeType":"Pre","ProgramID":"0","MajorMinorID":"0"}, {"ProgID":"17","ProgramName":"Pre-Physician
Assistant","DegreeType":"Pre","ProgramID":"159","MajorMinorID":"0"}, {"ProgID":"18","ProgramName":"Pre-
Seminary","DegreeType":"Pre","ProgramID":"0","MajorMinorID":"0"}, {"ProgID":"19","ProgramName":"Pre-
Veterinary","DegreeType":"Pre","ProgramID":"0","MajorMinorID":"0"}, {"ProgID":"20","ProgramName":"Pre-
Med","DegreeType":"Pre","ProgramID":"111","MajorMinorID":"111"} ]}
[/code]
My HTML:
[code]
$(document).ready(function() {
$('#example').dataTable( {
"iDisplayLength": 1,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "search.asp",
"aoColums": [
{"sName": "ProgID", "mDataProp": "ProgID"},
{"sName": "ProgramName", "mDataProp": "ProgramName" },
{"sName": "DegreeType", "mDataProp": "DegreeType" },
{"sName": "ProgramID", "mDataProp": "ProgramID" },
{"sName": "MajorMinorID", "mDataProp": "MajorMinorID" }
]
} );
} );
Entries in the Degree Table:
<!-- table goes here -->
ProgID
ProgramName
DegreeType
ProgramID
MajorMinorID
[/code]
This discussion has been closed.
Replies
Allan