コード例 #1
0
ファイル: index.php プロジェクト: ibergonzi/country
            if ($key == 'attribute') {
                $poSel[] = $i;
                $poItems[$i] = $searchModel->getAttributeLabel($value);
                break;
            }
        }
    } else {
        $poSel[] = $i;
        $poItems[$i] = $searchModel->getAttributeLabel($c);
    }
}
// tiene que estar fuera del Pjax
echo PopoverX::widget(['options' => ['id' => 'popControl'], 'placement' => PopoverX::ALIGN_RIGHT, 'toggleButton' => ['label' => '<i class="glyphicon glyphicon-list"></i> Cols.a exportar', 'class' => 'btn btn-default pull-left'], 'header' => 'Elija las columnas a exportar', 'size' => 'lg', 'content' => Html::checkboxList('exportColumns', $poSel, $poItems, ['class' => 'form-control', 'tag' => false])]);
//}
// Definición de la cantidad de items a paginar
$contentToolbar = \nterms\pagesize\PageSize::widget(['defaultPageSize' => \Yii::$app->params['tiposdoc.defaultPageSize'], 'sizes' => \Yii::$app->params['tiposdoc.sizes'], 'label' => '', 'options' => ['class' => 'btn btn-default', 'title' => 'Cantidad de elementos por página']]);
// Definición del toolbar
//if (\Yii::$app->user->can('PERMISOPARAEXPORTAR')) {
$toolbar = ['{export} ', ['content' => $contentToolbar]];
//} else {
//	$toolbar=[['content'=>$contentToolbar]];
//}
?>

    <?php 
echo GridView::widget(['options' => ['id' => 'gridID'], 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $columns, 'pjax' => true, 'pjaxSettings' => ['neverTimeout' => true], 'condensed' => true, 'layout' => '&nbsp;{toolbar}{summary}{items}{pager}', 'filterSelector' => 'select[name="per-page"]', 'export' => ['label' => 'Exportar', 'fontAwesome' => true, 'showConfirmAlert' => true, 'target' => GridView::TARGET_BLANK], 'toolbar' => $toolbar, 'pager' => ['firstPageLabel' => true, 'lastPageLabel' => true], 'exportConfig' => [GridView::PDF => ['filename' => $this->title, 'config' => ['destination' => 'D', 'methods' => ['SetHeader' => [['odd' => $pdfHeader, 'even' => $pdfHeader]], 'SetFooter' => [['odd' => $pdfFooter, 'even' => $pdfFooter]]], 'options' => ['title' => $this->title, 'subject' => '', 'keywords' => ''], 'contentBefore' => '', 'contentAfter' => '']], GridView::EXCEL => ['filename' => $this->title, 'config' => ['worksheet' => $this->title, 'cssFile' => '']], GridView::CSV => ['filename' => $this->title, 'config' => ['colDelimiter' => ";", 'rowDelimiter' => "\r\n"]]]]);
?>
 

<?php 
Modal::begin(['id' => 'modalcomentarionuevo', 'header' => '<span class="btn-warning">&nbsp;Comentarios&nbsp;</span>']);
コード例 #2
0
ファイル: consegrgrupal.php プロジェクト: ibergonzi/country
        }
    }
    //echo '<div class="clearfix"></div>';
    // tiene que estar fuera del Pjax
    echo PopoverX::widget(['options' => ['id' => 'popControl'], 'placement' => PopoverX::ALIGN_RIGHT, 'toggleButton' => ['label' => '<i class="glyphicon glyphicon-list"></i> Cols.a exportar', 'class' => 'btn btn-default pull-left'], 'header' => 'Elija las columnas a exportar', 'size' => 'lg', 'content' => Html::checkboxList('exportColumns', $poSel, $poItems, ['class' => 'form-control', 'tag' => false])]);
    // para que no se encime con el summary del gridview
    //echo '<div class="clearfix"></div>';
}
if ($consulta) {
    $dps = \Yii::$app->params['accesos.defaultPageSize'];
    $sz = \Yii::$app->params['accesos.sizes'];
} else {
    $dps = \Yii::$app->params['accesosEgr.defaultPageSize'];
    $sz = \Yii::$app->params['accesosEgr.sizes'];
}
$contentToolbar = \nterms\pagesize\PageSize::widget(['defaultPageSize' => $dps, 'sizes' => $sz, 'label' => '', 'options' => ['class' => 'btn btn-default', 'title' => 'Cantidad de elementos por página']]);
if ($consulta && \Yii::$app->user->can('exportarConsDentro')) {
    $toolbar = ['{export} ', ['content' => $contentToolbar]];
} else {
    $toolbar = [['content' => $contentToolbar]];
}
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'options' => ['id' => 'gridAccesos'], 'filterSelector' => 'select[name="per-page"]', 'pjax' => true, 'pjaxSettings' => ['neverTimeout' => true], 'containerOptions' => ['style' => 'overflow: visible'], 'condensed' => true, 'resizableColumns' => false, 'layout' => '&nbsp;{toolbar}{summary}{items}{pager}', 'export' => ['label' => 'Exportar', 'fontAwesome' => true, 'showConfirmAlert' => true, 'target' => GridView::TARGET_BLANK], 'toolbar' => $toolbar, 'pager' => ['firstPageLabel' => true, 'lastPageLabel' => true], 'exportConfig' => [GridView::PDF => ['filename' => $this->title, 'config' => ['destination' => 'I', 'methods' => ['SetHeader' => [['odd' => $pdfHeader, 'even' => $pdfHeader]], 'SetFooter' => [['odd' => $pdfFooter, 'even' => $pdfFooter]]], 'options' => ['title' => $this->title], 'contentBefore' => '', 'contentAfter' => '']], GridView::EXCEL => ['filename' => $this->title, 'config' => ['worksheet' => $this->title, 'cssFile' => '']], GridView::CSV => ['filename' => $this->title, 'config' => ['colDelimiter' => ";", 'rowDelimiter' => "\r\n"]]], 'columns' => $columns]);
Modal::begin(['id' => 'modalcomentarionuevo', 'header' => '<span class="btn-warning">&nbsp;Comentarios&nbsp;</span>']);
echo '<div id="divcomentarionuevo"></div>';
Modal::end();
// modal para los mensajes
Modal::begin(['id' => 'modalmensaje', 'header' => '<span class="btn-warning">&nbsp;Mensajes&nbsp;</span>', 'options' => ['class' => 'nofade']]);
echo '<div id="divmensaje"></div>';
Modal::end();
?>
</div>
コード例 #3
0
ファイル: index.php プロジェクト: su-xiaolin/ICShop-Yii
use yii\grid\ActionColumn;
use yii\grid\CheckboxColumn;
use yii\helpers\Url;
use nterms\pagesize\PageSize;
use mickgeek\actionbar\Widget as ActionBar;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Product Category'), 'url' => ['index']];
$this->params['breadcrumbs'][] = Yii::t('app', 'List');
$this->title = '产品分类';
?>

<div class="row">
    <div class="col-md-12">
        <div class="row">
            <div class="col-md-3">
                <?php 
echo PageSize::widget(['label' => '行/页']);
?>
            </div>
            <div class="col-md-6">
                <?php 
echo ActionBar::widget(['grid' => 'w2', 'templates' => ['{bulk-actions}' => ['class' => 'col-xs-4']], 'bulkActionsItems' => ['常规' => ['general-delete' => '删除']], 'bulkActionsOptions' => ['options' => ['general-delete' => ['url' => Url::toRoute('delete-multiple'), 'data-confirm' => '确定吗?']], 'class' => 'form-control']]);
?>
            </div>
            <div class="col-md-3">
                <a class="btn btn-info pull-right btn-block" href="<?php 
echo Url::to(['product-category/create']);
?>
"><i class="fa fa-plus"></i> <?php 
echo Yii::t('app', 'Create');
?>
</a>
コード例 #4
0
 /**
  * Renders validator errors of filter model.
  * @return string the rendering result.
  */
 public function renderPageSizeWidget()
 {
     if (!empty($this->sizes)) {
         $sizesKeys = array_keys($this->sizes);
         return PageSize::widget(['encodeLabel' => false, 'label' => Yii::t('vendor/voskobovich/yii2-advanced-grid/interface/common', 'Size:') . '&nbsp;', 'labelOptions' => ['class' => 'control-label', 'style' => 'font-weight: normal'], 'template' => Html::tag('div', '{label}{list}', ['class' => 'form-group']), 'options' => ['class' => 'form-control input-sm'], 'defaultPageSize' => $sizesKeys[0], 'sizes' => $this->sizes]);
     }
     return '';
 }