Table Not Loading Data

Table Not Loading Data

cfdltechcfdltech Posts: 10Questions: 0Answers: 0
edited December 2012 in General
My development is internal so no link.

I have copied the server-side php/ajax example exactly. My JSON validates in Lint.

My data won't load. I get no data available in table displayed. I used the debugger which said my JSON was bad.

My debugger is uqukoy

Here is my JSON

[code]
{
"sEcho": 0,
"iTotalRecords": "8276",
"iTotalDisplayRecords": "8276",
"aaData": [
[
"",
"CMS",
"Custom Micro Systems",
"",
"",
"",
"",
"",
""
],
[
"",
"Administrator",
"System",
"",
"",
"",
"",
"",
""
],
[
"",
"Fred",
"Flintlock",
"Bedderberg",
"FL",
"",
"",
"",
""
],
[
"",
"",
"",
"",
"",
"",
"",
"",
""
],
[
"",
"",
"",
"Bushville",
"GA",
"",
"",
"",
""
],
[
"",
"Harold",
"Stone",
"Orlando",
"FL",
"",
"",
"",
""
],
[
"",
"Learned",
"Hand",
"Orlando",
"FL",
"",
"",
"",
""
],
[
"",
"Gang",
"Green",
"Orlando",
"FL",
"",
"",
"",
""
],
[
"",
"",
"",
"Orlando",
"FL",
"",
"",
"",
""
],
[
"",
"Alex",
"Attorney",
"",
"",
"",
"",
"",
""
]
]
}
[/code]

javascript:
[code]

$(document).ready(function() {
$('#recentintakes').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "tabledata/datatable_json.php"
} );
} );

[/code]

html

[code]



Intake DateFirst NameLast NameCityStateStatusCase TypeReferralAd Source





[/code]

Replies

  • allanallan Posts: 63,531Questions: 1Answers: 10,474 Site admin
    The debugger says your initialisation code is:

    [code]
    {
    "sPaginationType": "bootstrap",
    "oLanguage": {
    "sSearch": "",
    "sLengthMenu": "Limit: _MENU_"
    },
    "sDom": "T<\"clear\">lfrtip",
    "oTableTools": {
    "sSwfPath": "js/tableTools/swf/copy_csv_xls_pdf.swf"
    }
    }
    [/code]

    So server-side processing is not enabled.

    Can you link to a test case please?

    Allan
  • cfdltechcfdltech Posts: 10Questions: 0Answers: 0
    ?
    I'm not sure what that code does. It just looks like it's calling an swf, but those buttons don't appear to be flash. Does this mean dataTables does not work on iOS devices?

    If that swf file has to load then that may be the problem because the script that has the dataTable embedded in it is in a lower directory.

    var/www/site/area1/pagewithdatatable.php

    The dataTable files are:

    var/www/site/js/tableTools/swf/.........


    In my embed file all the tags point correctly to the path of the .js files to load dataTables javascripts.

    [code]

    [/code]

    Is there some document that explains how to call dataTables correctly when using in other areas of the site. I'm not sure why this path is not resolving correctly in the src, but it is probably looking for:

    var/www/site/area1/js/tableTools/swf/......

    which is wrong.

    I don't put all my site files in the web root, certain pages will be in a directory like /controlpanel or /clientarea.

    There's gotta be a way for this path to resolve correctly as I can't imagine dataTables expects all 'calling' files to be in upper directories, right? Thanks for your help.

    Otherwise, specifically where do I enable/disable server-side processing?
  • cfdltechcfdltech Posts: 10Questions: 0Answers: 0
    Correction:

    The table tool files

    /var/www/site/js/tableTools/

    The dataTables src

    /var/www/site/js/
  • cfdltechcfdltech Posts: 10Questions: 0Answers: 0
    Those are all minor problems... I'm using a template I purchased and the author has a script they call custom.js which is causing the jquery initialization code not to work.

    I removed that script and the data loaded, but that script added other template elements so I am working with the author to get fixed.

    Thanks. Obviously, this is still a huge problem with js frameworks.
  • cfdltechcfdltech Posts: 10Questions: 0Answers: 0
    Simply, the author had already initialized the dataTable call and preconfigured some dataTable options. Thanks for the help.
This discussion has been closed.