<?php
echo $this->renderUseCases($checkedCheckboxes, $form, $model);
?>
<script>
    $(document).ready(function () {
        $('#cert-grid_Modal_saveBtn').button("reset");
        getAlreadyUsedUseCases();
    });

    function getAlreadyUsedUseCases() {
        var url = '<?php echo url('networkCertificateSettings/default/getAlreadyUsedUseCases'); ?>';
        var id = '<?php echo $model->id; ?>';
        $.ajax({
            type: "POST",
            dataType: "json",
            url: url,
            data: {id: id}
        }).success(function (data) {
            $.each(data, function (i, e) {
                if (e !== 0) {
                    $('#CertUseCase_' + e).removeAttr("checked");
                    $('#CertUseCase_' + e).attr('disabled', 'disabled');
                }
            });
        });
    }

</script>