events not trigered

events not trigered

pmengopmengo Posts: 74Questions: 37Answers: 2
edited March 2016 in Editor

I need help to figure why postSubmit, submitComplete dont fire after create a new row.

 editor.on('postSubmit', function ( e, json, data, action ) {
            if (myTableName.operation == "SELECT") {

                tbl.api()
                    .search(myTableName.dbColumns)
                    .draw();
            }

        });

preSumit event is fired but none of other related to submit. Thanks in advance

Answers

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    The postSubmit event will occur before the new row has been added to the table. postEdit will be triggered immediately after it has been added.

    What is the data that you are returning from the server? Does it match the JSON structure required by Editor?

    Thanks,
    Allan

  • pmengopmengo Posts: 74Questions: 37Answers: 2

    yes , bad json...!!!!!

  • pmengopmengo Posts: 74Questions: 37Answers: 2
    edited March 2016

    this is the returned json
    {
    "data": [
    {
    "RHID": "100",
    "NOME": "Leon11 7676676754654",
    "NOME_REDZ": "Matias testes",
    "EMAIL": "fghfgh@kkk.ll",
    "EMAIL_PESSOAL": null,
    "TELEMOVEL_1": "(545) 454 545 454",
    "TELEMOVEL_2": null,
    "SEXO": "F",
    "CD_PAIS": "PT",
    "CD_DISTRITO": "13"
    }
    ],
    "total_Records": "1"
    }

    but still have no feedback or error or postSubmit event fired

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    Are you able to link to the page showing the issue please? That looks like it should work.

    Thanks,
    Allan

  • pmengopmengo Posts: 74Questions: 37Answers: 2

    http://www.quad-systems.pt/QUAD_HCM/#ajax/datatablePROTO.php

    please click left upper corner button(pesquisa avançada) and filter by RHID=>100 or >100 or whatever exists . Json is returned and is ok.

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    The data isn't loading at the moment I'm afraid. I've getting a Javascript error when I load the page:

    Uncaught SyntaxError: Unexpected token E .

    Allan

This discussion has been closed.