Question about accessing row data inside of PHP files in Editor

Question about accessing row data inside of PHP files in Editor

chillychilly Posts: 7Questions: 4Answers: 0

Hello, I've been trying to use DataTables with an inhouse Grails REST API, and have been wondering how to access row from an Editor instance.

I've been trying to following some examples like so:
$object = Editor::inst($db, 'yourtable')
->field.... ( your fields here)
->process($_POST);

$data = $object->data();

In this example, I want to be able to directly access the row information that I've sent to my PHP file for processing. What is the mechanism that I can use to access this row information?

Answers

  • allanallan Posts: 62,522Questions: 1Answers: 10,272 Site admin

    I want to be able to directly access the row information that I've sent to my PHP file for processing

    The Editor manual details the client / server communication protocol that Editor uses. Specifically in this case, the data on create and edit for the row will be in $_POST['data'].

    Allan

  • chillychilly Posts: 7Questions: 4Answers: 0

    I ended up getting my code to work, but now even after a successful row insertion, I get an error that "An error has occurred - Please contact the system administrator." As far as I am concerned, the submission worked as I intended.

    I am not submitting the data directly to the database is a subsequent script, so is there a graceful way to halt the execution after my successful REST API submission?

  • allanallan Posts: 62,522Questions: 1Answers: 10,272 Site admin
    edited June 2014

    "An error has occurred - Please contact the system administrator."

    This error means that the data being returned from the server is not valid JSON. What is being returned (tech note 1 explains how to view the Ajax return)?

    Allan

This discussion has been closed.