Standalone server side

Standalone server side

doshdikdoshdik Posts: 3Questions: 2Answers: 0
edited June 2014 in Free community support

Hello, I have a problem to implement standalone editor to my page. There is no examples for server side part for standalone editor. For example i have a table with 3 columns: (id, name, description), and only 1 row: ('1', 'test', test1'). And i want to create standalone editor for this values with three text inputs. No create, no delete, just edit this 3 values. When i using jqery script from first example (with html like 'dl' 'dt' 'dd' and <data-editor-field> option) and server script like:

Editor::inst( $db, 'table' )
  ->fields(
    Field::inst( 'id' ),
    Field::inst( 'name' ),
    Field::inst( 'description' )
    )
  ->where( 'id', '1')
  ->process( $_POST )
  ->json();

i've got empty fields and i can't edit anything. It's just adding new rows to my table with the data i've entered when i push the Update button and shows the error message: "An error has occurred - Please contact the system administrator" .
So how my server side script sholud look like in this situation?

Answers

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin

    Hi,

    The Editor PHP instance is used for row based editing and isn't necessarily useful for standalone editing. Can can be used, but to be honest, I would suggest doing a very simply UPDATE on the database since that is all that is really needed.

    An error has occurred - Please contact the system administrator

    If you have a look at the Ajax return from the server, what is it returning?

    Are you able to link to the page so I can take a look and see what is happening?

    Regards,
    Allan

This discussion has been closed.