Server Processing Display

Server Processing Display

nikvenikve Posts: 19Questions: 2Answers: 0
edited February 2013 in General
I will fully admit to being a full newbie at this but for some reason I cannot get my data from my database to display using the datatable format. I have edited the server_processing.php with everything, have the initialization in my index file but the page is coming up with just my table info. I think what's hanging me up is what to put here:

[code]"fnServerData": ... /* Include function source from plug-in */[/code]

Replies

  • nikvenikve Posts: 19Questions: 2Answers: 0
    http://debug.datatables.net/ecixib
    Here is my debug

    Here is the site:
    http://rpwith.us/Test2/
  • essexstephessexsteph Posts: 57Questions: 0Answers: 0
    If you look at the output from your php, e.g. put http://www.rpwith.us/Test2/DataTables/scripts/server_processing.php in the address bar then you'll see there's some strange html tags in the json return, e.g.

    [code],["_-Cheeky Chobit-_ & Perky Persocom","Joseph","M","1","","Alicorn","Halloween '08 - Gaia EI - Angel Imp","Chibizoo","Tag<\/a>","","",""][/code]

    Viewing the source of your test case page the table doesn't finish, there's no and no , both of which are required for DataTables (see http://datatables.net/usage/).

    Also the table doesn't finish properly, no end , this may because of the malformed json.

    Get those sorted and see what happens.

    Steph
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    I don't understand why you are trying to use server-side processing when the data in already in the table?

    Plus what Steph says :-)

    Allan
  • nikvenikve Posts: 19Questions: 2Answers: 0
    edited February 2013
    I fussed with the and and now it is showing the "Show ___ entries" and the search but it doesn't function and it just says 'processing'

    I'm not sure why it's showing that strange html in there - the ahref HTML I'm seeing within the sql table is displaying perfectly normal. I need the Tag row to have clickable info. (I'm not lying when I say I'm a newbie, but I'm trying really hard to learn).

    I've removed the call for the Tag column where the link html was, and it made no difference.

    Allan - I'd like to use server-side processing because I've got over 7,000 rows of data, and add more to it every day due to the nature of the site I'm using it for. Right now I have it reading in a php table from the sql database. I did it that way because it was turning up a blank page before I put in any table info.

    So basically, what do I need for server-side processing to work?
  • essexstephessexsteph Posts: 57Questions: 0Answers: 0
    You seem to have a for every row rather than one for the entire body, plus I can't see a closing .

    If you look at the javascript console you also have an error:

    XMLHttpRequest cannot load http://www.rpwith.us/Test2/DataTables/scripts/server_processing.php?sEcho=1…=true&bSortable_9=true&bSortable_10=true&bSortable_11=true&_=1360586793433. Origin http://rpwith.us is not allowed by Access-Control-Allow-Origin.

    That's why the processing display never disappears.

    Steph
  • nikvenikve Posts: 19Questions: 2Answers: 0
    I think I fixed the tbody and closing table issues. As far as the error, I'm not sure how to fix it.
  • essexstephessexsteph Posts: 57Questions: 0Answers: 0
    The clue is in the error :-) Your server is treating http://www.rpwith.us and http://rpwith.us as two separate sites! If you access your test site as http://www.rpwith.us/test2/ then things are beginning to work.

    You have 2 errors to sort out - one is that you are sending the headers twice though this doesn't affect DataTables, the second is that your table is set up for 12 columns but you are only returning 8 in the json output of your php script.

    Steph
  • nikvenikve Posts: 19Questions: 2Answers: 0
    edited February 2013
    I think I got it to work! Thank you so much for your help - Can you see anymore problems before I call it a wrap?

    It does seem to lag a little bit, though. I'm not sure if it's because I didn't set up server side correctly and it's using a regular script, or if it's just slow on 7k data rows even with server processing.
This discussion has been closed.