AdditionalData in Dashboard Modal

Permalink
Hi Everyone,

I'm pulling my hair out. Building a site for a golf course with a custom dashboard page for managing tee times. Click a button to bring up a modal using this code

<script type="text/javascript">
   $('a.book_tee_time').on('click', function() {
      var tee_time_id = $(this).closest('tr').attr('data-tee_time_id');
      $.fn.dialog.open({
         href: '/dialog/book_tee_time?tee_time_id='+tee_time_id,
         title: 'Book Tee Time',
         width: '600',
         height: 'auto',
         modal: true
      });
      return false;
   });
</script>


I've got my modal form all setup. User fills out the form, the controller does it's thing to make the tee time. At the end it sends back the success message along with the tee time id.

$response = new EditResponse();
$response->setMessage('Tee Time Booked');
$response->setAdditionalDataAttribute('booked_tee_time_id', $booked_tee_time->getID());
$response->outputJSON();


I need that ID so I can update the page appropriately. However, I can't for the life of me figure out how to access that data! I know it's possible; the file manager is doing it when you add a folder! And I can see the data sent back in the JSON. How does my Javascript access that JSON data? I've spent hours digging through c5 code.

Any insight is appreciated.

Thanks.

JeffPaetkau
 
JeffPaetkau replied on at Permalink Reply
JeffPaetkau
Anyone? I've managed to mostly avoid needing to do this. However, there is still one spot where I really need to get data from a modal.