<?php
echo CHtml::beginForm();
$this->widget('ext.PlGrid.PlGridView', array(
    'id' => 'network-dhcp-grid',
    'headerTitle' => 'NETWORK_DHCP_TITLE',
    'enableAddButton' => false,
    'summaryText' => false,
    'enableSearchButton' => false,
    'showNavbar' => true,
    'hideHeader' => true,
    'useCustomTitle' => true,
    'showAlertBlock' => true,
    'alertAutoHide' => false,
    'dataProvider' => $model->getSectionItems($section),
    'customButtons' => $this->getTabItems($model),
    'columns' => array(
        array(
            'name' => 'label',
            'type' => 'raw',
        ),
        array(
            'name' => 'value',
            'type' => 'raw',
            'value' => array($this, 'renderValue'),
        ),
    ),
        )
);

echo CHtml::hiddenField('action', 'save');
echo CHtml::submitButton('save', array('id' => 'saveSettingsSectionAction', 'style' => 'display:none'));

$this->widget('bootstrap.widgets.TbButton', array(
    'buttonType' => 'button',
    'type' => 'primary',
    'label' => __('GLOBAL_SAVE_BUTTON'),
    'loadingText' => 'loading...',
    'htmlOptions' => array(
        'id' => 'saveSettingsSectionButton',
        'data-translation-id' => 'GLOBAL_SAVE_BUTTON',
    ),
));
echo CHtml::endForm();
?>


<script>
    $('#saveSettingsSectionButton').click(function () {
        var btn = $(this);
        btn.button('loading'); // call the loading function
        $("#saveSettingsSectionAction").click();
    });
</script>