Hello all,
I am trying to use a snippet to process a cell edit from TableKit.
http://www.millstream.com.au/view/code/tablekit/
I am stumped on how to reference a snippit from a javascript include like this.
It seems to stop parsing at the ’=’ and loads the index page instead of the results from the aliased snippet. How do I escape the ’=’, or even better, how can I call the snippet directly instead of the page alias? Using the ID listed in MODx for the snippet doesn’t seem to work either since there are usually pages with the same ID
<script type="text/javascript"><!--
TableKit.options.editAjaxURI = 'index.php?page=edit_table';
// --></script>
Here is my snippet:
<?php
header('Content-Type: text/plain; charset=UTF-8');
global $modx;
$table = "modx_site_medialibrary";
$id = $_POST['id'];
$value = $_POST['value'];
$field = $_POST['field'];
$rows_affected = $modx->db->update($field=$value, $table, id=$id);
echo $value;
?>
I have also tried putting the PHP in a stand alone file, but the UPDATE call doesn’t work...
Thank you for any suggestions!