Error with DataTables Editor

Error with DataTables Editor

inesines Posts: 9Questions: 2Answers: 0
edited June 2014 in Free community support

I'm trying to run the DataTables/extensions/Editor-1.3.1/examples/simple/i18n.html page but when I press the buttons 'nouveau' or 'modifier' or 'supprimer' it shows me an error message and do not do updates requested

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    The error message indicates that there was an error with the request at the server. What is the Ajax response from the server? You can find that out using the developer tools in your browser.

    Allan

  • inesines Posts: 9Questions: 2Answers: 0

    Uncaught TypeError: Cannot read property 'error' of undefined !!! please hlp me

  • inesines Posts: 9Questions: 2Answers: 0

    error on this file DataTables/extensions/Editor-1.3.1/js/dataTables.editor.js:294

  • inesines Posts: 9Questions: 2Answers: 0

    Hi allan,
    I tested the same page on my local server, everything works fine but putting it on my remote server, the above was an error appears, there's there a specific configuration for this problem

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Can you tell me what the Ajax return from the server, in response to the Ajax request is. Not the Javascript error.

    Failing that, please link me to to the page so I can take a look.

    Allan

  • inesines Posts: 9Questions: 2Answers: 0

    how to do this?? sorry for the inconvenience I am a beginner, thx

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    This tech note shows how it can be done: http://datatables.net/manual/tech-notes/1#Server-data

    Allan

  • inesines Posts: 9Questions: 2Answers: 0

    it show me this
    {"fieldErrors":[{"name":"first_name","status":null},{"name":"last_name","status":null},{"name":"extn","status":null},{"name":"age","status":null},{"name":"salary","status":null},{"name":"start_date","status":null}]}

  • inesines Posts: 9Questions: 2Answers: 0
    edited June 2014

    I finally managed to solve the problem, so I removed the validators and I modified the staff.php file like this:

     <? Php
    
    / *
     * Example PHP implementation used for the example index.html
     * /
    
    / / DataTables PHP library
    include ("/ / php / DataTables.php....");
    
    / / Alias ​​Editor classes So They are easy to use
    use
    DataTables \ Editor,
    DataTables \ Editor \ Field,
    DataTables \ Editor \ Format
    DataTables \ Editor \ Join,
    DataTables \ Editor \ Validate;
    
    / / Build our Editor instance and process the data coming from _POST
    Editor :: inst ($ db, 'datatables_demo')
    -> Fields (
    Field :: inst ('first_name')
    Field :: inst ('last_name')
    Field :: inst ('position')
    Field :: inst ('email'),
    Field :: inst ('office')
    Field :: inst ('extn')
    Field :: inst ('age')
    Field :: inst ('salary')
    Field :: inst ('start_date')
    
    -> GetFormatter ('Format :: date_sql_to_format' Format :: DATE_ISO_8601)
    -> SetFormatter ('Format :: date_format_to_sql' Format :: DATE_ISO_8601)
    )
    -> Process ($ _POST)
    -> Json ();
    
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Good to hear you got it working in the end.

    In the JSON return in your previous post, that looks like valid JSON to me. Did the server not return anything else at all? I was expecting a PHP warning message.

    Allan

  • inesines Posts: 9Questions: 2Answers: 0

    Thank you very much for your real help,
    Actually the warning message that appears was PHP.

This discussion has been closed.