$deleteRow = $modx->myDB->getObject('LogData',array('callid' => $callid)); if ($deleteRow->remove() == false) { echo 'An error occurred while trying to remove the row!'; }
<button type="button" class="btn btn-danger" onclick="[[!dbrowdelete? &callid=`[[+callid]]`]]">Delete</button>
This question has been answered by Bruno17. See the first response.
<a href="[[~[[*id]]? &callid=`[[+callid]]`]]">
<button type="button" class="btn btn-danger" data-callid="[[+callid]]">Delete</button> <script> $('button').on('click', function() { var callid = $(this).data('callid'); $.ajax({ url: "[[~7]]" // let's say your ajax resource id is '7' ,data: { callid: callid } ,type: 'post' ,success: function(data) { // do something if successful } }); }); </script>