<div class="datagrid-widget">
    <?php if (!$disableToolbar): ?>
        <?= $toolbarWidget->render() ?>
    <?php endif ?>

    <div
        id="<?= $this->getId() ?>"
        style="width:100%"
        class="control-datagrid"
        data-control="datagrid"
        data-allow-remove="<?= $allowRemove ? 'true' : 'false' ?>"
        data-autocomplete-handler="<?= $this->getEventHandler('onAutocomplete') ?>"
        <?php if ($dataLocker): ?>data-data-locker="<?= $dataLocker ?>"<?php endif ?>
        <?php if ($useDataSource): ?>data-source-handler="<?= $this->getEventHandler('onDataSource') ?>"<?php endif ?>
        <?php if ($monitorChanges): ?>data-change-handler="<?= $this->getEventHandler('onDataChanged') ?>"<?php endif ?>
        ></div>

</div>
<script>
    $('#<?= $this->getId() ?>')
        .data('columns', <?= json_encode($columnDefinitions) ?>)
        .data('columnHeaders', <?= json_encode($columnHeaders) ?>)
        .data('columnWidths', <?= json_encode($columnWidths) ?>)
        <?php if ($data): ?>.data('data', <?= json_encode($data) ?>)<?php endif ?>
</script>
