language.emptytable not working

language.emptytable not working

pushpendra0694pushpendra0694 Posts: 3Questions: 0Answers: 0

if there is no record found in database on query then only loading... shows instead of no record found in datatable, and there is error in console - Uncaught TypeError: Cannot read property 'error' of null. all working fine if there is more then 0 records found in database on query.

Replies

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736
    edited May 2020

    Sounds like you have server side processing enabled. Start by looking at the response from the server when there are no rows found in the search. Take a look at the JSON response using the browser's network inspector tool. Use this technote for steps if needed.

    EDIT: The server side response should look like this example. Click on the Ajax tab and perform a search that results in 0 records, type zip for example.

    Kevin

  • pushpendra0694pushpendra0694 Posts: 3Questions: 0Answers: 0

    https://jyotionline.in/testcase

    there is no pending status in database so database returning null and datatable showing loading instead of "No data available in table"

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    Yep, in that case, your script is returning null, which isn't valid JSON. It should return an empty array, [], if there are no entries.

    Colin

  • pushpendra0694pushpendra0694 Posts: 3Questions: 0Answers: 0

    Thanks colin.
    Finally I got Solution and it worked for me.

This discussion has been closed.