本文整理汇总了PHP中kartik\dynagrid\DynaGrid::widget方法的典型用法代码示例。如果您正苦于以下问题:PHP DynaGrid::widget方法的具体用法?PHP DynaGrid::widget怎么用?PHP DynaGrid::widget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kartik\dynagrid\DynaGrid
的用法示例。
在下文中一共展示了DynaGrid::widget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
<?php
/**
* @var \yii\web\View $this
* @var \app\modules\shop\models\OrderStage $searchModel
* @var \yii\data\ActiveDataProvider $dataProvider
*/
use yii\helpers\Html;
use yii\helpers\Url;
use kartik\icons\Icon;
$this->title = Yii::t('app', 'Order stages leafs');
$this->params['breadcrumbs'] = [['label' => Yii::t('app', 'Order stage subsystem'), 'url' => Url::to(['index'])], $this->title];
?>
<?php
echo app\widgets\Alert::widget(['id' => 'alert']);
?>
<?php
$this->beginBlock('buttons');
echo Html::a(Icon::show('plus') . Yii::t('app', 'Add'), Url::to(['leaf-edit']), ['class' => 'btn btn-success']);
$this->endBlock();
echo \kartik\dynagrid\DynaGrid::widget(['options' => ['id' => 'stages-leafs-list'], 'columns' => ['id', ['attribute' => 'stage_from_id', 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
return $model->stageFrom->name;
}], ['attribute' => 'stage_to_id', 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
return $model->stageTo->name;
}], 'button_label', 'event_name', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => [['url' => 'leaf-edit', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => Yii::t('app', 'Edit')], ['url' => 'leaf-delete', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => Yii::t('app', 'Delete'), 'options' => ['data-action' => 'delete']]]]], 'userSpecific' => false, 'showPersonalize' => false, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['buttons']]]]);
示例2: isset
<?php
use yii\helpers\Html;
use app\func\Proc;
use kartik\dynagrid\DynaGrid;
/* @var $this yii\web\View */
/* @var $searchModel app\models\Fregat\TrOsnovSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Установленные материальные ценности';
$this->params['breadcrumbs'] = Proc::Breadcrumbs($this);
?>
<div class="tr-osnov-index">
<?php
$result = Proc::GetLastBreadcrumbsFromSession();
$foreign = isset($result['dopparams']['foreign']) ? $result['dopparams']['foreign'] : '';
echo DynaGrid::widget(Proc::DGopts(['options' => ['id' => 'tr-osnovgrid'], 'columns' => Proc::DGcols(['buttonsfirst' => true, 'columns' => ['idInstallakt.installakt_id', ['attribute' => 'idInstallakt.installakt_date', 'format' => 'date'], 'idMattraffic.idMaterial.material_name', 'idMattraffic.idMaterial.material_inv', 'idMattraffic.idMaterial.material_serial', 'idMattraffic.idMol.idbuild.build_name', 'tr_osnov_kab', ['attribute' => 'idMattraffic.idMol.idperson.auth_user_fullname', 'label' => 'ФИО материально-ответственного лица'], 'idMattraffic.idMol.iddolzh.dolzh_name'], 'buttons' => array_merge(empty($foreign) ? [] : ['chooseajax' => ['Fregat/tr-osnov/assign-to-select2']])]), 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['heading' => '<i class="glyphicon glyphicon-pushpin"></i> ' . $this->title]]]));
?>
</div>
示例3:
<a href="<?= Yii::$app->urlManager->createUrl(['caixa/fechar'])?>" class="btn btn-danger"><i class="fa fa-times"></i> Fechar</a>
</div>
<div class="col-md-3">
<h3><?php echo Yii::$app->formatter->asCurrency($caixa->valor) ?> </h3>
</div>
</div>
<div class="row">
<div class="col-md-12">
<?php Pjax::begin(); ?>
<?= DynaGrid::widget([
'columns' => $columns,
'theme' => 'panel-danger',
'showPersonalize' => false,
'gridOptions' => [
'dataProvider' => $dataProvider,
//'filterModel' => $searchModel,
'showPageSummary' => false,
],
'options' => ['id' => 'dynagrid-1'],
]); ?>
<?php Pjax::end(); ?>
</div>
</div>
<!-- Modal Saida Despesas -->
<div class="modal fade" id="modalSaidaDespesas" role="dialog" aria-labelledby="modalSaidaDespesasLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
示例4: function
* @var \yii\web\View $this
* @var \yii\data\ActiveDataProvider $dataProvider
* @var \app\components\SearchModel $searchModel
*/
use yii\helpers\Html;
$this->title = Yii::t('app', 'Customers');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="customers-index">
<?php
echo \kartik\dynagrid\DynaGrid::widget(['options' => ['id' => 'customers-index-grid'], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => Html::tag('h3', $this->title, ['class' => 'panel-title']), 'after' => Html::a(\kartik\icons\Icon::show('plus') . Yii::t('app', 'Add'), ['create', 'returnUrl' => \app\backend\components\Helper::getReturnUrl()], ['class' => 'btn btn-success'])], 'rowOptions' => function ($model, $key, $index, $grid) {
/** @var \app\modules\shop\models\Customer $model */
if (intval($model->user_id) <= 0) {
return ['class' => 'warning'];
}
return [];
}], 'columns' => ['id', ['attribute' => 'orders', 'label' => Yii::t('app', 'Orders count'), 'value' => function ($model, $key, $index, $column) {
/** @var \app\modules\shop\models\Customer $model */
return count($model->orders);
}], ['attribute' => 'user', 'label' => Yii::t('app', 'User'), 'value' => function ($model, $key, $index, $column) {
/** @var \app\modules\shop\models\Customer $model */
/** @var \app\modules\user\models\User $user */
$user = $model->user;
return null === $user ? Yii::t('app', 'Guest') : $user->username;
}], 'first_name', 'middle_name', 'last_name', 'email', 'phone', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => function ($model, $key, $index, $parent) {
$result = [['url' => 'edit', 'icon' => 'eye', 'class' => 'btn-info', 'label' => Yii::t('app', 'View')]];
return $result;
}]]]);
?>
</div>
示例5: function
if (\app\models\Risk::find()->where(['Code' => $model->Code])->exists()) {
return Html::a('<span class="glyphicon glyphicon-remove" style="display: none"></span>', '#', ['title' => 'หัวข้อนี้มีอยู่ในระบบแล้ว']);
} else {
return Html::a('<span class="glyphicon glyphicon-check"></span>', $url, ['title' => 'เลือกหัวข้อนี้']);
}
}], 'urlCreator' => function ($action, $model, $key, $index) {
if ($action === 'use_id') {
return Url::to(['risk/create', 'code' => $model->Code]);
}
/*if (\app\models\Risk::find()->where([ 'Code' => $model->Code])->exists()) {
return Url::to(['#']);
}else{
return Url::to(['risk/create', 'code' => $model->Code]);
}*/
}], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => false, 'order' => DynaGrid::ORDER_FIX_RIGHT]];
echo DynaGrid::widget(['columns' => $columns, 'storage' => DynaGrid::TYPE_COOKIE, 'theme' => 'panel-info', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">รายการความเสี่ยงหลัก</h3>', 'before' => '{dynagrid}']], 'options' => ['id' => 'dynagrid-1']]);
?>
</div>
</div>
<?php
/*
= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'IRID',
'Corp',
'Branch',
示例6:
* @var yii\data\ActiveDataProvider $dataProvider
* @var \app\models\Page $searchModel
*/
use kartik\dynagrid\DynaGrid;
$this->title = Yii::t('app', 'Pages');
$this->params['breadcrumbs'][] = $this->title;
?>
<?php
echo \dmstr\widgets\Alert::widget(['id' => 'alert']);
?>
<?php
$this->beginBlock('buttonGroup');
?>
<div class="btn-toolbar" role="toolbar">
<div class="btn-group">
<?php
echo \yii\helpers\Html::a('<i class="fa fa-plus"></i> ' . Yii::t('app', 'Add'), ['/admin-pages/edit'], ['class' => 'btn btn-success']);
?>
</div>
</div>
<?php
$this->endBlock();
?>
<?php
echo DynaGrid::widget(['options' => ['id' => 'page-grid'], 'columns' => [['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], ['class' => 'yii\\grid\\DataColumn', 'attribute' => 'title'], 'created_at', ['class' => \app\components\ActionColumn::className()]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['buttonGroup']]]]);
示例7:
<?php
use app\backend\components\Helper;
use app\backend\widgets\RemoveAllButton;
use kartik\dynagrid\DynaGrid;
use kartik\grid\CheckboxColumn;
use kartik\icons\Icon;
use yii\helpers\Html;
/**
* @var yii\web\View $this
* @var yii\data\ActiveDataProvider $dataProvider
* @var \app\models\Form $searchModel
*/
$this->title = Yii::t('app', 'Thumbnail size');
$this->params['breadcrumbs'][] = $this->title;
?>
<?php
$this->beginBlock('add-button');
echo Html::a(Icon::show('plus') . ' ' . Yii::t('app', 'Add'), ['edit', 'returnUrl' => Helper::getReturnUrl()], ['class' => 'btn btn-success']);
echo RemoveAllButton::widget(['url' => '/image/backend-thumbnail-size/remove-all', 'gridSelector' => '.grid-view', 'htmlOptions' => ['class' => 'btn btn-danger pull-right']]);
$this->endBlock();
?>
<?php
echo DynaGrid::widget(['options' => ['id' => 'form-grid'], 'columns' => [['class' => CheckboxColumn::className(), 'options' => ['width' => '10px']], 'id', 'width', 'height', 'quality', ['class' => 'app\\backend\\components\\ActionColumn', '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')]], 'options' => ['width' => '85px']]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . $this->title . '</h3>', 'after' => $this->blocks['add-button']]]]);
示例8:
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>
示例9: 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 . '} )']);
}
?>
示例10: 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>
示例11: 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> Состав материальной ценности']]]));
示例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
/**
* @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']]]]);
示例15: jQuery
</article>
</div>
</section>
<?php
ActiveForm::end();
?>
<?php
$js = <<<JS
"use strict";
\$('input[data-group]').change(function() {
var object = jQuery(this);
if (object.prop('checked')) {
\$('input[data-group="' + object.data('group') + '"]').not('[name="' + object.attr('name') + '"]').prop('checked', false);
}
});
JS;
$this->registerJs($js);
?>
<?php
if ($model->has_static_values) {
?>
<?php
echo DynaGrid::widget(['options' => ['id' => 'property-grid'], 'columns' => [['class' => 'yii\\grid\\DataColumn', 'attribute' => 'id'], 'name', 'value', 'slug', ['class' => 'app\\backend\\components\\ActionColumn', 'buttons' => [['url' => 'edit-static-value', 'icon' => 'pencil', 'class' => 'btn-primary', 'label' => 'Edit'], ['url' => 'delete-static-value', 'icon' => 'trash-o', 'class' => 'btn-danger', 'label' => 'Delete']], 'url_append' => '&property_id=' . $model->id . '&property_group_id=' . $model->property_group_id]], 'theme' => 'panel-default', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">' . Yii::t('app', 'Static values') . '</h3>', 'after' => $this->blocks['add-button']]]]);
?>
<?php
}