Server side processing....

Server side processing....

K0ZZM0K0ZZM0 Posts: 7Questions: 0Answers: 0
edited October 2010 in General
can someone post the html file for displaying the server data....

because I don't get any error nor any data in the table....

I used the server processing code from here and it doesn't display anything.....

can someone help me out?
Can I get any help with the javascript debugging... i'm new to javascript ... I don't know how to track down where the problem is occuring...

thanks in advance for the help....

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Have you looked at the examples: http://datatables.net/examples/server_side/server_side.html . That possibly the best source for information. Next step after that is to use Firebug to trace the Ajax requests and see what is going on.

    Allan
  • K0ZZM0K0ZZM0 Posts: 7Questions: 0Answers: 0
    Yes I did look at those examples... does not work...

    Could someone help me through with the debugging in firebug ? I have it installed but I'm just starting with the ajax (javascript) part and I don't realy know where to look...

    Could someone walk me through step by step?

    thanks in advance....
    Maybe an online tutorial?
  • cfanscfans Posts: 8Questions: 0Answers: 0
    You'll want to enable the "Script" and "Net" tabs in firebug. I'd start with making sure you've got the latest version of JQuery and DataTables and get that server-side example of allan's working. It's a great simple example, and certainly does work. I'd even start with the Ajax example first.. http://datatables.net/examples/data_sources/ajax.html

    This should go without saying.. but you need to host the JSON file on your machine (change sAjaxSource)..
    [code]
    $(document).ready(function() {
    $('#example').dataTable( {
    "bProcessing": true,
    "sAjaxSource": '../examples_support/json_source.txt'
    } );
    } );
    [/code]
  • K0ZZM0K0ZZM0 Posts: 7Questions: 0Answers: 0
    the script and net tabs are enabled but what do I have to look for then?

    Ok, but I don't see where I have to find the html code in there examples... only the insert of the javascript...

    where do I find the source of the table?

    What are the important things I have to look for to make this work?

    How can I track if he finds the datasource? Lets say when I change intentionally the datasource file name...
  • cfanscfans Posts: 8Questions: 0Answers: 0
    From your post, it sounds like your HTML / JavaScript and to that effect JQuery experience is very limited. I think you should pick up a book on JavaScript and learn the basics before approaching JQuery and a plug-in like DataTables. Learn the foundation stuff first, everyone has to start somewhere. (Let's also ignore firebug for now, get a friend to show you how it works)

    I will answer your questions however if you'd like to continue on the path of figuring out datatables, although after a few chapters of a JavaScript book this would make much more sense.

    The code snippet I posted is looking for an html table one that's id is "example", the jquery $('#example') to be exact. So that means you must have an html table, you also need to define the headings, the simpliest approach is to do a "view source" on Allans example page. You'll see his table looks like:
    [code]



    Rendering engine
    Browser
    Platform(s)
    Engine version
    CSS grade







    Rendering engine
    Browser
    Platform(s)
    Engine version
    CSS grade



    [/code]

    Import your JavaScript JQuery libraries and the datatables library
    [code]


    [/code]

    Remember to put that JavaScript snippet I posted previously in your head section.. change the json_source.txt to the correct location. You may download it from: http://datatables.net/examples/examples_support/json_source.txt
    [code]

    $(document).ready(function() {
    $('#example').dataTable( {
    "bProcessing": true,
    "sAjaxSource": '../examples_support/json_source.txt'
    } );
    } );

    [/code]


    I can't stress enough.. get Allan's example working FIRST. Copy the code from his example page and start there. I've walked you through everything.. that's about all that can be done.
  • K0ZZM0K0ZZM0 Posts: 7Questions: 0Answers: 0
    YES!

    Works! thanks for the help... my custom server-side script works........! But still weird... debugged it in IE instead of firefox.... kinda problem with my firefox that put me on the wrong track when debugging....
This discussion has been closed.