Buttons not appear and JSON being printed on screen along side table

Buttons not appear and JSON being printed on screen along side table

cbasmadjiancbasmadjian Posts: 56Questions: 14Answers: 0
edited October 2016 in Free community support

Not sure if these 2 issues are connected to each other, but the warning messages that I am receiving seems to me that I might be missing something additional. The warning messages are as follows...

Warning: Invalid argument supplied for foreach() in /home/.../DataTables-Editor/Editor/Editor.php on line 569

Warning: Invalid argument supplied for foreach() in /home/.../DataTables-Editor/Editor/Editor.php on line 586
{"data":[]}
Warning: Cannot modify header information - headers already sent by (output started at /home/.../DataTables-Editor/Editor/Editor.php:569) in /home/.../post.php on line 197

Warning: Cannot modify header information - headers already sent by (output started at /home/.../DataTables-Editor/Editor/Editor.php:569) in /home/.../pluggable.php on line 1174

What I see on my page is the JSON data from the database printed at the top of the screen. Also, my datatable is correctly displaying that same data. How do I get rid of that extra JSON at the top?

I updated my client side to include buttons and including the necessary scripts, but the add, edit, and delete buttons are not showing. The only script that I am uncertain is the bootstrap version of editor. I don't have any bootstrap installed on my page so not sure if that will cause any issues.

Is there any way you can help me out?

http://www.fifth-cloud.com/hairstyle-photo-submission/

Thank you!

This question has an accepted answers - jump to answer

Answers

  • cbasmadjiancbasmadjian Posts: 56Questions: 14Answers: 0

    I was using the live datatables to recreate my issue to little success. However, I was able to fix my button issue for not appearing. Instead of using my script I thought I would use this Editor Example (https://editor.datatables.net/examples/simple/server-side-processing.html) as my starting point. I copied the client side script and started from there. In order to get my data to appear on the live datatables I had to use jsonp. I will be turning it off and using regular json once I figure out how to use this tool.

    My current issue is it is reporting 0 results when clearly you can see my 3 results. What am I doing wrong? Further, if you try editing the data it correctly edits, but it states that something went wrong.

    Am I missing scripts/dependencies? Any help would be greatly appreciated.

    http://live.datatables.net/wuvavaje/1/edit

  • allanallan Posts: 63,818Questions: 1Answers: 10,517 Site admin
    Answer ✓

    Thanks for the link. Unfortunately I get a 404 not found ("Ooops, page not found") when loading the fifth-cloud.com address above.

    In the JSBin, you are getting:

    Showing 0 to 0 of 0 entries

    Because the JSON data being returned from the server doesn't contain the parameters required by DataTables for server-side processing. Unless you are expecting tens of thousands of rows, I'd suggest you just remove the serverSide option.

    See this page in the documentation for more information about client and server-side processing in DataTables.

    Regards,
    Allan

  • cbasmadjiancbasmadjian Posts: 56Questions: 14Answers: 0
    edited October 2016

    Thanks for the tip. That did address the results found.

    I would prefer to have a pop up dialog box with the form like the example has. How do I do that? Is there another example that goes over this?

    By the way, thanks for letting me know about the 404, I fixed the issue (I think).

    Could you take a look as to what is causing the json data to appear at the top of my page? Any thoughts?

    Feel as though I am nearly complete configuring this.

  • allanallan Posts: 63,818Questions: 1Answers: 10,517 Site admin

    I would prefer to have a pop up dialog box with the form like the example has. How do I do that? Is there another example that goes over this?

    Most of the Editor examples use that lightbox modal.

    Could you take a look as to what is causing the json data to appear at the top of my page? Any thoughts?

    Something in your server-side script it outputting it. I'm afraid I have no idea what it would be as I can't see the server-side code.

    Regards,
    Allan

This discussion has been closed.