本文整理汇总了PHP中kartik\dynagrid\DynaGrid类的典型用法代码示例。如果您正苦于以下问题:PHP DynaGrid类的具体用法?PHP DynaGrid怎么用?PHP DynaGrid使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DynaGrid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
<?php
/**
* @var yii\web\View $this
* @var yii\data\ActiveDataProvider $dataProvider
* @var \app\models\Submission $searchModel
*/
use yii\helpers\Html;
$this->title = Yii::t('app', 'Submissions');
$this->params['breadcrumbs'][] = ['url' => ['/backend/form/index'], 'label' => Yii::t('app', 'Forms')];
$this->params['breadcrumbs'][] = $this->title;
$this->beginBlock('buttons');
echo Html::beginTag('div', ['class' => 'form-group no-margin']);
if (Yii::$app->request->get('show_deleted') == 1) {
echo Html::a(Yii::t('app', 'Show undeleted'), ['/backend/form/view', 'id' => Yii::$app->request->get('id')], ['class' => 'btn btn-info']);
} else {
echo Html::a(Yii::t('app', 'Show deleted'), ['/backend/form/view', 'id' => Yii::$app->request->get('id'), 'show_deleted' => 1], ['class' => 'btn btn-danger']);
}
echo Html::endTag('div');
$this->endBlock('buttons');
echo \kartik\dynagrid\DynaGrid::widget(['options' => ['id' => 'submission-grid'], 'columns' => ['id', 'date_received', 'ip', 'user_agent', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => function ($model, $key, $index, $parent) {
if (1 === $model->is_deleted) {
return [['url' => 'view-submission', 'icon' => 'eye', 'class' => 'btn-info', 'label' => 'View'], ['url' => 'restore-submission', 'icon' => 'refresh', 'class' => 'btn-success', 'label' => 'Restore'], ['url' => 'delete-submission', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => 'Delete']];
}
return [['url' => 'view-submission', 'icon' => 'eye', 'class' => 'btn-info', 'label' => 'View'], ['url' => 'delete-submission', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => 'Delete']];
}, 'options' => ['width' => '50px']]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['buttons']]]]);
示例2: function
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'ข้อมูล Sepsis Shock';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="sepsis-shock-index">
<?php
// echo $this->render('_search', ['model' => $searchModel]);
?>
<p>
<?php
echo Html::a('บันทึกข้อมูลใหม่', ['create'], ['class' => 'btn btn-success']);
?>
<?php
echo Html::a('ระบบรายงาน', ['report1'], ['class' => 'btn btn-info']);
?>
</p>
<?php
$columns = [['attribute' => 'id', 'width' => '30px', 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center'], ['attribute' => 'hn', 'width' => '120px', 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center'], ['attribute' => 'time2hos', 'width' => '120px', 'hAlign' => 'center', 'headerOptions' => ['style' => 'text-align:center']], ['attribute' => 'CausesepsisName', 'headerOptions' => ['style' => 'text-align:center']], ['attribute' => 'reason_refer1', 'width' => '160px', 'headerOptions' => ['style' => 'text-align:center']], ['attribute' => 'reason_refer2', 'width' => '160px', 'headerOptions' => ['style' => 'text-align:center']], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => false, 'vAlign' => 'middle', 'template' => '{view} {update} {delete}', 'buttons' => ['view' => function ($url, $model, $key) {
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['view', 'id' => $model->id], ['title' => 'ดูรายละเอียด', 'data-toggle' => 'tooltip']);
}, 'update' => function ($url, $model, $key) {
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['update', 'id' => $model->id], ['title' => 'แก้ไขรายละเอียด', 'data-toggle' => 'tooltip']);
}, 'delete' => function ($url, $model, $key) {
return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['delete', 'id' => $model->id], ['title' => 'ลบรายการ', 'data-toggle' => 'tooltip', 'data-method' => 'post', 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?')]);
}]]];
echo DynaGrid::widget(['columns' => $columns, 'storage' => DynaGrid::TYPE_COOKIE, 'theme' => 'panel-warning', 'enableMultiSort' => false, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => true, 'panel' => ['heading' => '<h3 class="panel-title">รายการ Sepsis Shock</h3>']], 'options' => ['id' => 'dynagrid-1'], 'showSort' => true]);
?>
</div>
示例3: isset
<?php
use yii\helpers\Html;
use kartik\dynagrid\DynaGrid;
use app\func\Proc;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel app\models\Fregat\TrMatSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Установленные комплектующие';
$this->params['breadcrumbs'] = Proc::Breadcrumbs($this);
?>
<div class="tr-mat-index">
<?php
$result = Proc::GetLastBreadcrumbsFromSession();
$foreign = isset($result['dopparams']['foreign']) ? $result['dopparams']['foreign'] : '';
echo DynaGrid::widget(Proc::DGopts(['options' => ['id' => 'trmatgrid'], 'columns' => Proc::DGcols(['columns' => ['idMattraffic.idMaterial.material_name', 'idMattraffic.idMaterial.material_inv', 'idMattraffic.mattraffic_number', ['attribute' => 'idParent.idMaterial.material_name', 'label' => 'Укомплекторано в мат-ую цен-ть'], ['attribute' => 'idParent.idMaterial.material_inv', 'label' => 'Инвентарный номер мат-ой цен-ти, в которую укомплектован материал'], ['attribute' => 'idParent.idMol.idbuild.build_name', 'label' => 'Здание, где установлено'], ['attribute' => 'idParent.trOsnovs.tr_osnov_kab', 'label' => 'Кабинет, где установлено', 'value' => function ($model) {
return $model->idParent->trOsnovs[0]->tr_osnov_kab;
}], ['attribute' => 'idMattraffic.idMol.idperson.auth_user_fullname', 'label' => 'ФИО материально-ответственного лица'], ['attribute' => 'idMattraffic.idMol.iddolzh.dolzh_name', 'label' => 'Должность материально-ответственного лица']], 'buttons' => array_merge(empty($foreign) ? [] : ['chooseajax' => ['Fregat/tr-mat/assign-to-grid']])]), 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['heading' => '<i class="glyphicon glyphicon-align-paste"></i> ' . $this->title]]]));
?>
</div>
示例4:
<?php
/**
* @var yii\web\View $this
* @var yii\data\ActiveDataProvider $dataProvider
* @var \app\models\Form $searchModel
*/
use app\backend\components\ActionColumn;
use kartik\dynagrid\DynaGrid;
use kartik\grid\BooleanColumn;
use kartik\helpers\Html;
use kartik\icons\Icon;
$this->title = Yii::t('app', 'Content Blocks');
$this->params['breadcrumbs'][] = $this->title;
?>
<?php
echo app\widgets\Alert::widget(['id' => 'alert']);
?>
<?php
echo DynaGrid::widget(['options' => ['id' => 'backend-chunk-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], 'name', 'key', ['class' => BooleanColumn::className(), 'attribute' => 'preload'], ['class' => ActionColumn::className(), 'options' => ['width' => '95px'], 'buttons' => [['url' => 'edit', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete')]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/core/backend-chunk/edit', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']) . \app\backend\widgets\RemoveAllButton::widget(['url' => '/core/backend-chunk/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']])]]]);
示例5:
<?//php Pjax::begin(); ?>
<?= DynaGrid::widget([
'columns' => [
[
'attribute' => 'nomeFormaPagamento',
'header' => 'Forma Pagamento'
],
[
'attribute' => 'valor_pago',
'header' => 'Valor Pago',
'format' => 'currency',
'pageSummary' => true,
],
],
'theme' => 'panel-danger',
'showPersonalize' => false,
'gridOptions' => [
'dataProvider' => $dataProvider,
'panel' => [
'heading'=>'<h6 class="panel-title"><i class="glyphicon glyphicon-book"></i> Relatório Sintético de Caixa</h6>',
],
'showPageSummary' => true,
],
'options' => ['id' => 'dynagrid-1'],
]); ?>
<?//php Pjax::end(); ?>
<?/*= GridView::widget([
示例6: UploadedFiles
use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
use kartik\dynagrid\DynaGrid;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel app\models\Fregat\DocfilesSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Загруженные файлы';
$this->params['breadcrumbs'] = Proc::Breadcrumbs($this);
?>
<div class="docfiles-index">
<?php
$form = ActiveForm::begin();
?>
<?php
echo $form->field($model, 'docFile')->widget(FileInput::classname(), ['pluginOptions' => ['uploadUrl' => Url::to(['Fregat/docfiles/create']), 'dropZoneEnabled' => false, 'previewZoomSettings' => ['image' => ['width' => 'auto', 'height' => '100%']]], 'pluginEvents' => ["fileuploaded" => 'function(event, data, previewId, index) { UploadedFiles("docfilesgrid", event, data); }']]);
?>
<?php
ActiveForm::end();
?>
<?php
$result = Proc::GetLastBreadcrumbsFromSession();
$foreign = isset($result['dopparams']['foreign']) ? $result['dopparams']['foreign'] : '';
echo DynaGrid::widget(Proc::DGopts(['options' => ['id' => 'docfilesgrid'], 'columns' => Proc::DGcols(['columns' => [['attribute' => 'docfiles_ext', 'format' => 'raw', 'value' => 'docfiles_iconshow', 'contentOptions' => ['style' => 'width: 40px; text-align: center;'], 'filter' => false], ['attribute' => 'docfiles_name', 'format' => 'raw', 'value' => 'docfiles_name_html'], ['attribute' => 'docfiles_hash', 'visible' => false]], 'buttons' => array_merge(empty($foreign) ? [] : ['chooseajax' => ['Fregat/docfiles/assign-to-select2']], Yii::$app->user->can('DocfilesEdit') ? ['deleteajax' => ['Fregat/docfiles/delete']] : [])]), 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['heading' => '<i class="glyphicon glyphicon-file"></i> ' . $this->title]]]));
?>
</div>
示例7: Employee
<?php
echo $form->field($model, 'osmotraktmat_date')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATE, 'options' => ['options' => ['placeholder' => 'Выберите дату ...', 'class' => 'form-control setsession']]]);
?>
<?php
echo $form->field($model, 'id_master')->widget(Select2::classname(), Proc::DGselect2(['model' => $model, 'resultmodel' => new Employee(), 'fields' => ['keyfield' => 'id_master', 'resultfield' => 'idperson.auth_user_fullname'], 'placeholder' => 'Выберете пользователя', 'fromgridroute' => 'Fregat/employee/index', 'resultrequest' => 'Fregat/employee/selectinputemloyee', 'thisroute' => $this->context->module->requestedRoute, 'methodquery' => 'selectinput']));
?>
<?php
ActiveForm::end();
?>
<?php
if (!$model->isNewRecord) {
echo DynaGrid::widget(Proc::DGopts(['options' => ['id' => 'tr-mat-osmotrgrid'], 'columns' => Proc::DGcols(['columns' => ['idTrMat.idMattraffic.idMaterial.idMatv.matvid_name', 'idTrMat.idMattraffic.idMaterial.material_name', 'idTrMat.idMattraffic.idMaterial.material_inv', ['attribute' => 'idTrMat.idMattraffic.mattraffic_number', 'label' => 'Всего количество у материально-ответственного лица', 'visible' => false], 'tr_mat_osmotr_number', ['attribute' => 'idTrMat.idMattraffic.idMol.idperson.auth_user_fullname', 'label' => 'ФИО материально-ответственного лица'], ['attribute' => 'idTrMat.idMattraffic.idMol.iddolzh.dolzh_name', 'label' => 'Должность материально-ответственного лица'], ['attribute' => 'idTrMat.idParent.idMaterial.material_name', 'label' => 'В составе материальной ценности'], ['attribute' => 'idTrMat.idParent.idMaterial.material_inv', 'label' => 'Инвентарный номер материальной ценности в которую укомплектовано'], 'idReason.reason_text', 'tr_mat_osmotr_comment'], 'buttons' => ['update' => ['Fregat/tr-mat-osmotr/update'], 'deleteajax' => ['Fregat/tr-mat-osmotr/delete']]]), 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-compressed"></i> Осмотренные материалы</h3>', 'before' => Html::a('<i class="glyphicon glyphicon-download"></i> Добавить материал', ['Fregat/tr-mat-osmotr/create', 'foreignmodel' => 'TrMatOsmotr', 'url' => $this->context->module->requestedRoute, 'field' => 'id_osmotraktmat', 'id' => $model->primaryKey], ['class' => 'btn btn-success', 'data-pjax' => '0'])]]]));
}
?>
<div class="form-group">
<div class="panel panel-default">
<div class="panel-heading">
<?php
echo Html::submitButton($model->isNewRecord ? '<i class="glyphicon glyphicon-plus"></i> Создать' : '<i class="glyphicon glyphicon-edit"></i> Обновить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary', 'form' => 'Osmotraktmatform']);
?>
<?php
if (!$model->isNewRecord) {
echo Html::button('<i class="glyphicon glyphicon-list"></i> Скачать акт', ['id' => 'DownloadReport', 'class' => 'btn btn-info', 'onclick' => 'DownloadReport("' . Url::to(['Fregat/osmotraktmat/osmotraktmat-report']) . '", $(this)[0].id, {id: ' . $model->primaryKey . '} )']);
}
?>
示例8:
<?php
use kartik\helpers\Html;
use kartik\dynagrid\DynaGrid;
$this->title = Yii::t('app', 'Newsletter email list');
$this->params['breadcrumbs'][] = $this->title;
?>
<?php
echo app\widgets\Alert::widget(['id' => 'alert']);
?>
<div class="row">
<div class="col-md-12" id="jstree-more">
<?php
echo DynaGrid::widget(['options' => ['id' => 'subscribe_email_list-grid'], 'columns' => ['name', 'email', ['class' => 'app\\backend\\columns\\BooleanStatus', 'attribute' => 'is_active'], ['class' => 'app\\components\\ActionColumn', 'template' => '{update} {delete}']], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>']]]);
?>
</div>
</div>
示例9: function
<?php
use app\func\Proc;
use kartik\dynagrid\DynaGrid;
use yii\bootstrap\Html;
use yii\helpers\Url;
echo DynaGrid::widget(Proc::DGopts(['options' => ['id' => 'mattraffic_contain_grid'], 'columns' => Proc::DGcols(['columns' => ['id_installakt', ['attribute' => 'idInstallakt.installakt_date', 'format' => 'date'], 'idMattraffic.idMaterial.material_name', 'idMattraffic.idMaterial.material_inv', 'idMattraffic.mattraffic_number', ['attribute' => 'idMattraffic.idMol.idperson.auth_user_fullname', 'label' => 'Материально-ответственное лицо'], ['attribute' => 'idMattraffic.idMol.iddolzh.dolzh_name', 'label' => 'Должность материально-ответственного лица'], ['attribute' => 'idMattraffic.idMol.idbuild.build_name', 'label' => 'Здание материально-ответственного лица'], ['attribute' => 'idMattraffic.mattraffic_username', 'visible' => false], ['attribute' => 'idMattraffic.mattraffic_lastchange', 'format' => 'datetime', 'visible' => false]], 'buttons' => array_merge(['installaktmatreport' => function ($url, $model) {
return Html::button('<i class="glyphicon glyphicon-list"></i>', ['type' => 'button', 'title' => 'Скачать акт перемещения матер-ой цен-ти', 'class' => 'btn btn-xs btn-default', 'onclick' => 'DownloadReport("' . Url::to(['Fregat/installakt/installakt-report']) . '", null, {id: ' . $model->id_installakt . '} )']);
}])]), 'gridOptions' => ['dataProvider' => $dataProvider_mattraffic_contain, 'filterModel' => $searchModel_mattraffic_contain, 'panel' => ['heading' => '<i class="glyphicon glyphicon-th-list"></i> Состав материальной ценности']]]));
示例10:
use kartik\dynagrid\DynaGrid;
use kartik\grid\GridView;
use yii\helpers\Html;
//use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel app\modules\kerja\models\search\DataPanduanSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Data Panduans');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="data-panduan-index">
<?php
echo $this->render('_menu');
?>
<!--<h1><?php
echo Html::encode($this->title);
?>
</h1>-->
<?php
// echo $this->render('_search', ['model' => $searchModel]);
?>
<?php
echo DynaGrid::widget(['options' => ['id' => Yii::$app->controller->id . "-" . Yii::$app->controller->action->id . "-" . Yii::$app->user->identity->id], 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel], 'columns' => [['attribute' => 'judul', 'visible' => true], ['class' => 'kartik\\grid\\ActionColumn']]]);
?>
</div>
示例11: jQuery
<div class="row">
<div class="col-md-4">
<?php
echo TreeWidget::widget(['treeDataRoute' => ['getTree', 'selected_id' => $parent_id], 'changeParentAction' => 'move', 'reorderAction' => 'reorder', 'doubleClickAction' => ContextMenuHelper::actionUrl(['/page/backend/edit']), 'contextMenuItems' => ['edit' => ['label' => 'Edit', 'icon' => 'fa fa-pencil', 'action' => ContextMenuHelper::actionUrl(['/page/backend/edit'])], 'show' => ['label' => 'Show pages inside this page', 'icon' => 'fa fa-folder-o', 'action' => ContextMenuHelper::actionUrl(['/page/backend/index'], ['parent_id' => 'id'])], 'create' => ['label' => 'Create', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['/page/backend/edit'], ['parent_id' => 'id'])], 'delete' => ['label' => 'Delete', 'icon' => 'fa fa-trash-o', 'action' => new \yii\web\JsExpression("function(node) {\n jQuery('#delete-confirmation')\n .attr('data-url', '/page/backend/delete?id=' + jQuery(node.reference[0]).data('id'))\n .attr('data-items', '')\n .modal('show');\n return true;\n }")]]]);
?>
</div>
<div class="col-md-8" id="jstree-more">
<?php
$this->beginBlock('buttonGroup');
?>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group">
<?php
echo \yii\helpers\Html::a(Icon::show('plus') . Yii::t('app', 'Add'), ['/page/backend/edit', 'parent_id' => is_object($model) ? $model->id : 0, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success']);
?>
</div>
<?php
echo \app\backend\widgets\RemoveAllButton::widget(['url' => \yii\helpers\Url::toRoute(['/page/backend/remove-all', 'parent_id' => is_object($model) ? $model->id : 0]), 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]);
?>
</div>
<?php
$this->endBlock();
?>
<?php
echo DynaGrid::widget(['options' => ['id' => 'page-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'title'], 'slug', ['class' => 'app\\backend\\columns\\BooleanStatus', 'attribute' => 'published'], ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => [['url' => 'edit', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'clone', 'icon' => 'copy', 'class' => 'btn-success', 'label' => Yii::t('app', 'Clone')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete'), 'options' => ['data-action' => 'delete']]], 'url_append' => '&parent_id=' . (is_object($model) ? $model->id : 0)]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['buttonGroup']]]]);
?>
</div>
</div>
示例12: jQuery
<div class="row">
<div class="col-md-4">
<?php
echo TreeWidget::widget(['treeDataRoute' => ['getTree'], 'doubleClickAction' => ContextMenuHelper::actionUrl(['index', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id']), 'contextMenuItems' => ['show' => ['label' => 'Show products in category', 'icon' => 'fa fa-folder-open', 'action' => ContextMenuHelper::actionUrl(['index'], ['parent_id' => 'id'])], 'createProduct' => ['label' => 'Create product in this category', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['edit', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id'])], 'edit' => ['label' => 'Edit category', 'icon' => 'fa fa-pencil', 'action' => ContextMenuHelper::actionUrl(['/shop/backend-category/edit', 'returnUrl' => Helper::getReturnUrl()])], 'create' => ['label' => 'Create category', 'icon' => 'fa fa-plus-circle', 'action' => ContextMenuHelper::actionUrl(['/shop/backend-category/edit', 'returnUrl' => Helper::getReturnUrl()], ['parent_id' => 'id'])], 'delete' => ['label' => 'Delete', 'icon' => 'fa fa-trash-o', 'action' => new \yii\web\JsExpression("function(node) {\n jQuery('#delete-category-confirmation')\n .attr('data-url', '/backend/category/delete?id=' + jQuery(node.reference[0]).data('id'))\n .attr('data-items', '')\n .modal('show');\n return true;\n }")]]]);
?>
</div>
<div class="col-md-8" id="jstree-more">
<?php
echo DynaGrid::widget(['options' => ['id' => 'Product-grid'], 'columns' => [['class' => \kartik\grid\CheckboxColumn::className(), 'options' => ['width' => '10px']], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'name'], 'slug', ['class' => \kartik\grid\EditableColumn::className(), 'attribute' => 'active', 'editableOptions' => ['data' => [0 => Yii::t('app', 'Inactive'), 1 => Yii::t('app', 'Active')], 'inputType' => 'dropDownList', 'placement' => 'left', 'formOptions' => ['action' => 'update-editable']], 'filter' => [0 => Yii::t('app', 'Inactive'), 1 => Yii::t('app', 'Active')], 'format' => 'raw', 'value' => function (Product $model) {
if ($model === null || $model->active === null) {
return null;
}
if ($model->active === 1) {
$label_class = 'label-success';
$value = 'Active';
} else {
$value = 'Inactive';
$label_class = 'label-default';
}
return \yii\helpers\Html::tag('span', Yii::t('app', $value), ['class' => "label {$label_class}"]);
}], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'price', 'editableOptions' => ['inputType' => \kartik\editable\Editable::INPUT_TEXT, 'formOptions' => ['action' => 'update-editable']]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'old_price', 'editableOptions' => ['inputType' => \kartik\editable\Editable::INPUT_TEXT, 'formOptions' => ['action' => 'update-editable']]], ['attribute' => 'currency_id', 'class' => \kartik\grid\EditableColumn::className(), 'editableOptions' => ['data' => [0 => '-'] + \app\components\Helper::getModelMap(\app\modules\shop\models\Currency::className(), 'id', 'name'), 'inputType' => 'dropDownList', 'placement' => 'left', 'formOptions' => ['action' => 'update-editable']], 'filter' => \app\components\Helper::getModelMap(\app\modules\shop\models\Currency::className(), 'id', 'name'), 'format' => 'raw', 'value' => function ($model) {
if ($model === null || $model->currency === null || $model->currency_id === 0) {
return null;
}
return \yii\helpers\Html::tag('div', $model->currency->name, ['class' => $model->currency->name]);
}], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'sku', 'editableOptions' => ['inputType' => \kartik\editable\Editable::INPUT_TEXT, 'formOptions' => ['action' => 'update-editable'], 'placement' => 'left']], 'date_modified', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => [['url' => '@product', 'icon' => 'eye', 'class' => 'btn-info', 'label' => Yii::t('app', 'Preview'), 'appendReturnUrl' => false, 'url_append' => '', 'attrs' => ['model', 'mainCategory.category_group_id'], 'keyParam' => null], ['url' => 'edit', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'clone', 'icon' => 'copy', 'class' => 'btn-success', 'label' => Yii::t('app', 'Clone')], ['url' => 'delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete'), 'options' => ['data-action' => 'delete']]]]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['add-button']]]]);
?>
</div>
</div>
示例13: function
echo $form->field($dopparams['Glaukuchet'], 'glaukuchet_lastmetabol')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATE, 'options' => ['options' => ['placeholder' => 'Выберите дату ...', 'class' => 'form-control', 'disabled' => $dopparams['DisableElements']]], 'saveOptions' => ['class' => 'form-control setsession', 'form' => $formname]]);
?>
<?php
if ($model->isNewRecord || $dopparams['Glaukuchet']->isNewRecord) {
?>
<div class="alert alert-warning" role="alert">Для назначения лекарственных препаратов сохраните карту пациента.</div>
<?php
}
?>
<?php
if (!$model->isNewRecord && !$dopparams['Glaukuchet']->isNewRecord) {
$glprep_rlocat = app\models\Glauk\Glprep::VariablesValues('glprep_rlocat');
echo DynaGrid::widget(Proc::DGopts(['options' => ['id' => 'glprepgrid'], 'columns' => Proc::DGcols(['columns' => ['idPreparat.preparat_name', ['attribute' => 'glprep_rlocat', 'filter' => $glprep_rlocat, 'value' => function ($model) use($glprep_rlocat) {
return isset($glprep_rlocat[$model->glprep_rlocat]) ? $glprep_rlocat[$model->glprep_rlocat] : '';
}]], 'buttons' => array_merge(!$dopparams['DisableElements'] ? ['deleteajax' => ['Glauk/glprep/delete', 'glprep_id']] : [])]), 'gridOptions' => ['dataProvider' => $dopparams['dataProviderglprep'], 'filterModel' => $dopparams['searchModelglprep'], 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-tint"></i> Препараты</h3>', 'before' => !$dopparams['DisableElements'] ? Html::a('<i class="glyphicon glyphicon-download"></i> Добавить препарат', ['Glauk/glprep/create', 'idglaukuchet' => $model->glaukuchets->glaukuchet_id], ['class' => 'btn btn-success', 'data-pjax' => '0']) : '']]]));
}
?>
<div class="panel panel-<?php
echo Yii::$app->params['panelStyle'];
?>
">
<div class="panel-heading"><?php
echo Html::encode('Снятие с учета');
?>
</div>
<div class="panel-body">
<?php
echo $form->field($dopparams['Glaukuchet'], 'glaukuchet_deregdate')->widget(DateControl::classname(), ['type' => DateControl::FORMAT_DATE, 'options' => ['options' => ['placeholder' => 'Выберите дату ...', 'class' => 'form-control', 'disabled' => $dopparams['DisableElements']]], 'saveOptions' => ['class' => 'form-control setsession', 'form' => $formname]]);
示例14: function
<?php
if (is_file(\Yii::getAlias('@webroot') . '/' . $model->general_yml_filename)) {
echo Html::a(Icon::show('download') . Yii::t('app', 'Download'), \yii\helpers\Url::to($model->general_yml_filename, true), ['class' => 'btn btn-default']);
}
?>
<?php
BackendWidget::end();
?>
</div>
<div id="yml-properties-section" class="col-md-12">
<?php
$dataProvider = new \yii\data\ActiveDataProvider(['query' => $provider]);
echo \kartik\dynagrid\DynaGrid::widget(['options' => ['id' => 'Props-grid'], 'columns' => [['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'pgname', 'label' => Yii::t('app', 'Property Group ID')], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'name', 'label' => Yii::t('app', 'Property name')], ['class' => 'yii\\grid\\DataColumn', 'format' => 'raw', 'label' => Yii::t('app', 'Use in YML file'), 'value' => function ($model, $key, $index, $column) {
$data = \yii\helpers\Json::decode($model['handler_additional_params']);
return Html::checkbox('use_in_file', isset($data['use_in_file']) && $data['use_in_file'] == 1 ? true : false, ['class' => 'form-control', 'data-id' => $model['id'], 'data-type' => 'ajax-input']);
}], ['class' => 'yii\\grid\\DataColumn', 'format' => 'raw', 'label' => Yii::t('app', 'Measure'), 'value' => function ($model, $key, $index, $column) {
$data = \yii\helpers\Json::decode($model['handler_additional_params']);
return Html::input('text', 'unit', isset($data['unit']) ? $data['unit'] : '', ['class' => 'form-control', 'data-id' => $model['id'], 'data-type' => 'ajax-input']);
}]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . Yii::t('app', 'Properties import to YML') . '</h3>']]]);
?>
</div>
</div>
<?php
\kartik\widgets\ActiveForm::end();
?>
<?php
$this->beginBlock('jsValues');
?>
var $url = '<?php
echo \yii\helpers\Url::toRoute(['/shop/backend-yml/save-property-unit']);
示例15:
<div class="user-index">
<!-- <h1><?= Html::encode($this->title) ?></h1> -->
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?php Pjax::begin(); ?>
<?= DynaGrid::widget([
'columns' => [
['class' => 'kartik\grid\SerialColumn', 'order'=>DynaGrid::ORDER_FIX_LEFT],
'username',
'perfil',
[
'attribute' => 'lojaIdloja',
'value' => 'lojaIdloja.nome',
],
['class' => 'kartik\grid\ActionColumn', 'template' => '{view} {update}'],
],
'theme' => 'panel-danger',
'showPersonalize' => false,
'gridOptions' => [
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'showPageSummary' => false,
'panel' => ['before' => '{dynagrid}' . Html::a('Cadastrar', 'create', ['class' => 'btn btn-default'])],
],
'options' => ['id' => 'dynagrid-1'],
]); ?>
<?php Pjax::end(); ?>
</div>