Server-side : No matching records founds.

Server-side : No matching records founds.

FiaxhsFiaxhs Posts: 3Questions: 0Answers: 0
edited March 2009 in General
Hello Allan :)

I've got a problem with the 1.5 beta 6, while using server side processing.

Even if I get a result, the data isn't loaded in the table, and showing a "no matches found"... Maybe I've done something wrong ?

See attached video

http://fiaxhs.com/up/video.php?video=2009-03-31_1118.swf&width=906&height=625

Replies

  • FiaxhsFiaxhs Posts: 3Questions: 0Answers: 0
    edited March 2009
    OK, my fault -_-

    The HTML table got less columns than the numbers of columns in the result :] It's working really fine now.

    BTW, it's a really cool feature :)

    (Don't forget to see with me if you need some help for french translation)

    Guillaume LO RE.
  • djohdjoh Posts: 23Questions: 0Answers: 0
    Got the same issue, no really easy to troubleshoot though.

    You might like to display an appropriate error message if it is doable...

    Thx
  • allanallan Posts: 63,578Questions: 1Answers: 10,483 Site admin
    Hi guys,

    @Guillaume - good to hear you got it working. And yup any French translation, I'll give you a shout :-)

    @djoh - there are two common ways in which server-side processing will fail:
    1. The json return is not valid
    2. The json formatting is incorrect (be it the number of columns or the wrong parameters).

    JSONLint is ideal for debugging json issues: http://www.jsonlint.com/ (it's annoying that jQuery doesn't throw an error when it's eval fails...

    With regard to displaying an error message - yes this is something I'd like to look at, and have done briefly already, but it's quick difficult given the number of different data sources DataTables can take its data from :-). I'll have a look for the next beta...

    Allan
  • djohdjoh Posts: 23Questions: 0Answers: 0
    Wow, you're really involved in your project... That's great !
  • FiaxhsFiaxhs Posts: 3Questions: 0Answers: 0
    Hello djoh ;)

    Now that I've played a lot with this server side, here's the main reason I've encountered leading to the "No matching records found"

    1. As allan said, the Json is not valid ( unescaped quote or a break line in it)
    2. The number of columns in the HTML structure is different from the number of columns in the JSON result
    3. If you're using "aoColumns" in the dataTables initialisation, check you're describing the right number of columns

    @Allan thanks for JSONLint, this will be helpful !
This discussion has been closed.