In Concrete 5.6 it was possible to create a JavaScript callback. I would like to know how this can be achieved in 5.7. I want to select a page and then do an ajax call to get the area names from that page.
I took al look at the core files and the option for the callback does not exist anymore. I have used the js method to create the page selector.
<div data-field="entry-link-page-selector" class="form-group">
<label><?php echo t('Choose Page:') ?></label>
<div data-field="entry-link-page-selector-select"></div>
</div>
<script>
$('div[data-field=entry-link-page-selector-select]').concretePageSelector({
'inputName': 'cTargetID'
});
Old way
<?php echo $page_selector->selectPage('cTargetID', $cTargetID, 'pageChange'); ?>
-- update --
In the add.php and edit.php I include form.php. In this file I use the page_selector and the js to bind to the event. Still the event does not trigger the alert for some reason. I used the example as given in the answer below.
<?php
defined('C5_EXECUTE') or die (_("Acccess Denied"));
$al = Core::make('helper/concrete/asset_library');
$colorPicker = Core::make('helper/form/color');
$pageSelect= Core::make('helper/form/page_selector');
?>
<style>
.ccm-hide{display:none;}
</style>
<div class="subbscribe-form">
<div class="form-group">
<?php echo $pageSelect->selectPage('displayPagesCID', $displayPagesCID); ?>
</div>
</div>
<script>
Concrete.event.bind('SitemapSelectPage', function(e, data) {
alert('You selected "' + data.title + '", it\'s cID is ' + data.cID);
});
</script>