Standalone server side
Standalone server side
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
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.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