public function run() { $this->registerScripts(); if ($this->type == self::TYPE_INDEX) { Pjax::begin(['enablePushState' => false, 'enableReplaceState' => false, 'linkSelector' => '.pagination a']); } echo Html::tag('div', '', ['class' => 'ajax-crud-container ajax-crud-type-' . $this->type . ' ajax-crud-name-' . $this->name, 'id' => $this->getContainerId(), 'data' => ['type' => $this->type, 'name' => $this->name, 'container-index' => '#' . $this->getContainerId(self::TYPE_INDEX), 'container-create' => '#' . $this->getContainerId(self::TYPE_CREATE), 'container-update' => '#' . $this->getContainerId(self::TYPE_UPDATE)]]); if ($this->type == self::TYPE_INDEX) { Pjax::end(); } }
protected function getPjaxEnd() { $html = ''; if ($this->pjax) { ob_start(); Pjax::end(); $html = ob_get_clean(); } return $html; }
public function run() { if ($this->_pjax) { $this->_pjax->end(); } parent::run(); }
public function run(){ if($this->is_pjax){ Pjax::begin($this->pjaxOptions); } parent::run(); if($this->isShowForm) { echo PageSize::widget([ 'model' => $this->filterModel, 'attribute' => $this->attribute, 'options' => [ 'data-pjax' => '0', ], ]); } if($this->is_pjax){ Pjax::end(); } echo ModelCrud::widget([ 'size' => $this->modalSize, 'updateUrl' => ($this->updateUrl)? $this->updateUrl : Url::to(['update']), 'createUrl' => ($this->createUrl)? $this->createUrl : Url::to(['create']), 'updateVerb' => 'post', 'viewUrl' => Url::to(['view']), 'viewVerb' => 'post', 'createVerb' => 'post', 'modelTitle' => $this->modelTitle, 'template' => '{view}{update}{create}', 'modelClass' => $this->dataProvider->query->modelClass ]); }
function show_params($id, $product) { ?> <?php echo "<td><a href=\"../product?id=" . $product[$id]['product_id'] . "\">" . $product[$id]['name'] . "</a>" . "</td>"; ?> <?php echo "<td>" . $product[$id]['quantity'] . "</td>"; ?> <?php echo "<td>\$" . $product[$id]['price'] . "</td>"; ?> <?php echo "<td>\$" . $product[$id]['quantity'] * $product[$id]['price'] . "</td>"; ?> <?php Pjax::begin(); ?> <td><?php echo Html::a("Delete", ['../product/del?id=' . $product[$id]['product_id']], ['class' => 'btn btn-sm btn-danger', 'type' => 'button']); ?> </td> <?php Pjax::end(); ?> <?php }
/** * (non-PHPdoc) * @see \yii\widgets\ActiveForm::run() */ public function run() { parent::run(); Pjax::end(); if (!isset($this->template)) { $this->createDefaultTemplate(); } echo $this->render('template/footer', ['formModel' => $this->formModel, 'templateController' => $this->_module->templateController, 'displayedAttributes' => $this->displayedAttributes, 'fieldNames' => $this->template->fields, 'submitTitle' => $this->submitTitle]); Pjax::begin(['id' => 'template-panel-pjax']); echo $this->templatesPanel(); Pjax::end(); Pjax::end(); FlexibleFormAsset::register($this->view); }
public function run() { Pjax::begin(['enablePushState' => false, 'formSelector' => $this->getFormId()]); if (\Yii::$app->session->getFlash('yii2-params-updated')) { // TODO: review this custom alert code $closeButton = Html::button('×', ['data-dismiss' => 'alert', 'aria-hidden' => 'true', 'class' => 'close']); echo Html::tag('div', $closeButton . "Params updated successfully!", ['class' => 'alert-info alert fade in']); } /** @var \zarv1k\params\models\DynamicParam[] $models */ $models = \zarv1k\params\models\Params::getDynamicModels(); $form = ActiveForm::begin(['id' => $this->getFormId(), 'action' => \Yii::$app->getUrlManager()->createUrl("{$this->_moduleId}/manage")]); /** @var ActiveField $activeField */ $activeField = \Yii::$container->get('yii\\widgets\\ActiveField'); // TODO: review get from di foreach ($models as $model) { echo $form->field($model, "[{$model->owner->id}]{$model->owner->code}", ['labelOptions' => ArrayHelper::merge($activeField->labelOptions, ['label' => $model->owner->description, 'title' => $model->owner->name]), 'inputOptions' => ArrayHelper::merge($activeField->inputOptions, ['placeholder' => $model->owner->description, 'title' => $model->owner->name])]); } echo Html::submitButton($this->getSubmitContent(), $this->getSubmitOptions()); ActiveForm::end(); Pjax::end(); }
public function run() { $id = Html::getInputId($this->model, $this->attribute); $name = Html::getInputName($this->model, $this->attribute); Pjax::begin(['id' => $id, 'enablePushState' => false]); if ($this->model->{$this->attribute}) { echo $this->renderAddrobj($this->model->{$this->attribute}); echo $this->renderChildren($this->model->{$this->attribute}); // Выводит в скрытый инпут полное наименование для дальнейшего использования в гугл картах echo Html::hiddenInput(null, FiasHelper::toFullString($this->model->{$this->attribute}), ['class' => 'full-name']); } else { // Выводит в скрытый инпут полное наименование для дальнейшего использования в гугл картах echo Html::hiddenInput(null, null, ['class' => 'full-name']); $query = FiasAddrobj::find(); $query->andWhere(['parentguid' => 'f6e148a1-c9d0-4141-a608-93e3bd95e6c4', 'currstatus' => 0]); $query->orderBy('formalname'); $data = ArrayHelper::map($query->all(), 'aoguid', 'name'); echo $this->renderDropDownList($data); } echo Html::activeHiddenInput($this->model, $this->attribute, ['id' => null]); $this->view->registerJs("\n\n \$('#" . $id . " select').change(function(){\n \n \$.pjax.defaults.data = {\n '{$name}': \$(this).val(),\n };\n\n \$.pjax.reload('#" . $id . "', {\n type: 'POST'\n });\n\n });\n "); Pjax::end(); }
/** * Работаем! */ public function run() { $this->registerActionButtonsAssets(); $this->actionButtons(); Pjax::begin(['id' => $this->id . '-pjax']); $this->registerPluginAssets(); $this->renderMenu(); $this->renderForm(); Pjax::end(); $this->actionButtons(); }
]); // echo // GridView::widget([ // 'dataProvider' => $dataProvider, // 'filterModel' => $searchModel, // 'columns' => [ // ['class' => 'yii\grid\SerialColumn'], //// 'id', // 'name', // 'product_group_id', // 'code', // 'detail:ntext', // // 'created_time', // // 'last_update', // // 'user_id', // // 'product_unit_id', // ['class' => 'yii\grid\ActionColumn'], // ], // ]); ?> <?php Pjax::end() ?> </div> </div> <?php $this->registerJs(' $("#txtProductGroupId").on("input", function() { var id = $(this).val().trim(); queryItem(id, "product-category/search", "productgroup-product_category_id", "txtProductGroupName"); }); ');
['attribute'=>'fechacreacion_ft','format'=>['datetime',(isset(Yii::$app->modules['datecontrol']['displaySettings']['datetime'])) ? Yii::$app->modules['datecontrol']['displaySettings']['datetime'] : 'd-m-Y H:i:s A']], [ 'class' => 'yii\grid\ActionColumn', 'buttons' => [ 'update' => function ($url, $model) { return Html::a('<span class="glyphicon glyphicon-pencil"></span>', Yii::$app->urlManager->createUrl(['solicitud/view','id' => $model->id,'edit'=>'t']), [ 'title' => Yii::t('yii', 'Edit'), ]);} ], ], ], 'responsive'=>true, 'hover'=>true, 'condensed'=>true, 'floatHeader'=>true, 'panel' => [ 'heading'=>'<h3 class="panel-title"><i class="glyphicon glyphicon-th-list"></i> '.Html::encode($this->title).' </h3>', 'type'=>'info', 'before'=>Html::a('<i class="glyphicon glyphicon-plus"></i> Add', ['create'], ['class' => 'btn btn-success']), 'after'=>Html::a('<i class="glyphicon glyphicon-repeat"></i> Reset List', ['index'], ['class' => 'btn btn-info']), 'showFooter'=>false ], ]); Pjax::end(); ?> </div>
/** * @inheritdoc */ public function run() { if ($this->comments) { Pjax::begin(); echo Html::beginTag($this->tag, ArrayHelper::merge(['id' => $this->id], $this->options)); $this->renderComments($this->comments); echo Html::endTag($this->tag); echo Html::beginTag('nav', ['class' => 'comment-pagination']); echo LinkPager::widget(['pagination' => $this->pages, 'activePageCssClass' => 'active', 'disabledPageCssClass' => 'disabled', 'options' => ['class' => 'pagination']]); echo Html::endTag('nav'); Pjax::end(); } }
(with relation name) and this should be properly parsed when preparing the dataProvider to add filters. <div class="col-md-2">{quickSearch}</div> */ $layout = <<<HTML <div class="row"> <div class="col-md-12">{buttons}</div> </div> {items} <div class="row"> <div class="col-md-4">{pager}</div> <div class="col-md-4 summary">{summary}</div> <div class="col-md-4">{lengthPicker}</div> </div> HTML; if (!isset($relation['pjax']) || $relation['pjax']) { $pjax = Pjax::begin(['id' => $relationName . 'Pjax', 'linkSelector' => false]); $fieldId = \yii\helpers\Html::getInputId($model, $relationName); $script = <<<JavaScript \$('#{$relationName}Pjax').data('selectionFields', {'add': '#{$fieldId}-add', 'remove': '#{$fieldId}-remove'}); \$(document).pjax('#{$relationName}Pjax a', '#{$relationName}Pjax'); \$(document).on('pjax:beforeSend', '#{$relationName}Pjax', function(event, xhr, options) { var container = \$(event.target); xhr.setRequestHeader('X-Selection-add', \$(container.data('selectionFields').add).val()); xhr.setRequestHeader('X-Selection-remove', \$(container.data('selectionFields').remove).val()); }); JavaScript; $this->registerJs($script); } echo GridView::widget(['id' => $relationName . 'Grid', 'dataProvider' => $relation['dataProvider'], 'filterSelector' => "#{$relationName}Grid-quickSearch", 'columns' => $relation['columns'], 'layout' => isset($relation['layout']) ? $relation['layout'] : $layout, 'buttons' => isset($relation['buttons']) ? $relation['buttons'] : []]); $pjax !== null && Pjax::end();
/** * @inheritdoc */ public function run() { Pjax::end(); }
</div> <div class="box-body table-responsive no-padding"> <?php $stuFeesData = app\modules\fees\models\FeesPaymentTransaction::find()->where(['fees_pay_tran_stu_id' => $stuData->stu_master_id, 'fees_pay_tran_collect_id' => $FccModel->fees_collect_category_id, 'is_status' => 0]); $dataProvider = new ActiveDataProvider(['query' => $stuFeesData, 'sort' => ['defaultOrder' => ['fees_pay_tran_id' => SORT_DESC]], 'pagination' => ['pageSize' => 10]]); \yii\widgets\Pjax::begin(['enablePushState' => FALSE]); echo GridView::widget(['dataProvider' => $dataProvider, 'layout' => "{items}\n{pager}", 'showOnEmpty' => true, 'emptyText' => Yii::t('fees', 'No fees results found.'), 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'fees_pay_tran_id', ['attribute' => 'fees_pay_tran_date', 'value' => function ($data) { return Yii::$app->dateformatter->getDateDisplay($data['fees_pay_tran_date']); }], ['attribute' => 'fees_pay_tran_mode', 'value' => function ($data) { return $data->fees_pay_tran_mode == 1 ? "Cash" : "Cheque"; }], ['attribute' => 'fees_pay_tran_cheque_no', 'value' => function ($data) { return !empty($data->fees_pay_tran_cheque_no) ? $data->fees_pay_tran_cheque_no : "-"; }], ['attribute' => 'fees_pay_tran_bank_id', 'value' => function ($data) { return !empty($data->feesPayTranBank->bank_master_name) ? $data->feesPayTranBank->bank_master_name : "-"; }], 'fees_pay_tran_bank_branch', 'fees_pay_tran_amount', ['class' => 'app\\components\\CustomActionColumn', 'template' => '{update} {delete}']]]); \yii\widgets\Pjax::end(); ?> </div><!---End Pannel Body Of Student Payment History---> </div><!---End Payment History box Block---> <!--/div--> <!--------End responcive div tag------> <!--/div--> </div> <script> $(document).ready(function(){ var chkvalue = $('#feespaymenttransaction-fees_pay_tran_mode').val(); if(chkvalue==1) { $(".cheque-data").hide(); $(".cash-data").show(); }
</div> <div class="row"> <div class="col-md-4">' . $buttonsGraphLog . '</div> <div class="col-md-4 text-center">' . $buttonsMenu . '</div> <div class="col-md-4 text-right">' . $status . ' </div> </div> </div> <div id="graph' . $vm . '" class="panel-body collapse"> ' . $imgEth . ' </div> ' . $actionMenu . ' </div>'; Pjax::begin(['id' => 'pjax-' . $vm]); echo AlertBlock::widget(['type' => AlertBlock::TYPE_ALERT, 'useSessionFlash' => true, 'delay' => false]); echo $result; Pjax::end(['id' => 'pjax-' . $vm]); Modal::begin(['id' => 'modalGraphEth' . $vm, 'size' => Modal::SIZE_LARGE, 'header' => '<h3>Bandwidth ' . ucfirst($vm) . '</h3>', 'toggleButton' => false]); echo '<div id="modalGraphEthContent' . $vm . '"></div>'; Modal::end(); $this->registerJs('$(document).ready(function(){ $("#graph' . $vm . '").on("hide.bs.collapse", function(){ $("#btnGraph' . $vm . '").html(\'<span class="glyphicon glyphicon-collapse-down"></span> ' . Icon::show('area-chart') . '\'); }); $("#graph' . $vm . '").on("show.bs.collapse", function(){ $("#btnGraph' . $vm . '").html(\'<span class="glyphicon glyphicon-collapse-up"></span> ' . Icon::show('area-chart') . '\'); }); $("#logs' . $vm . '").on("hide.bs.collapse", function(){ $("#btnLogs' . $vm . '").html(\'<span class="glyphicon glyphicon-collapse-down"></span> ' . Icon::show('files-o') . '\'); }); $("#logs' . $vm . '").on("show.bs.collapse", function(){
<? // usage without model echo '<label class="control-label">Дата завершения кампании</label>'; echo DatePicker::widget([ 'name' => 'date_end', 'value' => $time_end, 'pluginOptions' => [ 'autoclose' => true, 'format' => 'yyyy-mm-dd', 'startDate' => $time_end, 'todayHighlight' => true ], ]); ?> <?Pjax::end();?> <br> <?php echo $form->field($model, 'link')->textinput(); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Обновить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end();
/** * Ends the PJAX container */ protected function endPjax() { if (!$this->pjax) { return; } echo ArrayHelper::getValue($this->pjaxSettings, 'afterGrid', ''); Pjax::end(); }
<h1><?= Html::encode($this->title) ?></h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?= Html::a(Yii::t('app', 'Create {model}', ['model'=>'Item pedido']), ['create'], ['class' => 'btn btn-success']) ?> </p> <?php Pjax::begin(); ?> <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], 'idPedido', // 'idProduto', [ 'label'=>'Produto', 'format'=>'text', 'value'=> function ($model) { return $model->nomeProduto; } ], 'quantidade', 'total', ['class' => 'yii\grid\ActionColumn'], ], ]); ?> <?php Pjax::end(); ?></div>
public function run() { if ($this->bootstrap && is_array($this->panel) && !empty($this->panel)) { $this->renderPanel(); } if (strpos($this->layout, '{export}') > 0) { $this->layout = strtr($this->layout, ['{export}' => $this->renderExport(), '{toolbar}' => $this->toolbar]); } else { $this->layout = strtr($this->layout, ['{toolbar}' => $this->toolbar]); } $this->layout = str_replace('{items}', Html::tag('div', '{items}', $this->containerOptions), $this->layout); $this->renderPjax(); parent::run(); if ($this->pjax) { echo ArrayHelper::getValue($this->pjaxSettings, 'afterGrid', ''); Pjax::end(); } }
</div> </div> <div class="ef-fix-h"> <div class="visible-pre-storm"> <div class="ribbon"> <a class="ribbon-inside toggle-alerts collapsed toggle-alerts-post" href="#" data-toggle="post-storm"> <span class="badge badge-green-white count-post-storm"><?php echo $unreadedPost ?></span> <span class="vsplit"></span> <i class="caret sharp lg"></i> <span class="alert-group-title">Post-Storm Alerts</span> </a> </div> </div> </div> </div> <?php yii\widgets\Pjax::end() ?> </div> <div class="split-frame"></div> <div class="split-pane right"> <?php echo AlertsWidget::widget() ?> </div> </div> <?php $script = <<< JS function updateStormInformation(row) { if ($('.choose-overlay').length) $('.choose-overlay').animate({opacity:0},500); setTimeout(function(){jQuery('.choose-overlay').remove()},500);
<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"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Saída - Despesas</h4> </div> <div class="modal-body"> <?/*= $this->render('/despesa/_form', [ 'model' => $despesa,
/** * End Pjax widget * @return Pjax widget instance that is ended. */ protected function renderContentEnd() { Pjax::end(); }
</td> <td class="c23"> <h1><?php echo Html::encode($model->title); ?> </h1> <?//= Html::img('/image/bannerfans_15821322.jpg', ['width'=>'100%']); ?> <p><?php echo Html::encode($model->description); ?> <br><br></p> <? if (!(Yii::$app->user->isGuest)) Pjax::begin(['id' => 'notes']); ?> <?php echo ListView::widget(['dataProvider' => $products, 'itemOptions' => ['class' => '_product'], 'layout' => "{items}\n{pager}\n", 'itemView' => '//product/_product', 'viewParams' => array('groups' => $groups)]); ?> <? if (!(Yii::$app->user->isGuest)) Pjax::end(); ?> </td> </tr> </table> <?php echo Html::input('hidden', 'this_category_id', $model->category_id, $options = ['class' => 'this_category_id']); echo Html::input('hidden', 'group_this_category_id', $model->category_id, $options = ['class' => 'group_this_category_id']); ?>
/** * @inheritdoc */ public function run() { $form = clone $this->form; if (empty($form->fieldConfig['template'])) { $form->fieldConfig['template'] = "{label}\n{input}\n{hint}\n{error}"; } if (empty($form->fieldConfig['labelOptions'])) { $form->fieldConfig['labelOptions'] = ['class' => 'control-label']; } $keys = array_keys($this->models); $form->fieldConfig['template'] = str_replace('{input}', $this->inputTemplate, $form->fieldConfig['template']); $button = Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-plus']), $this->urlAdd, $this->buttonOptions); echo $this->field($form, $this->models[$keys[0]], "[{$keys[0]}]{$this->attribute}", $button); if (!$this->labelEach) { $form->fieldConfig['template'] = str_replace('{label}', Html::tag('label', '', $form->fieldConfig['labelOptions']), $form->fieldConfig['template']); } if (!$this->hintEach) { $form->fieldConfig['template'] = preg_replace('/\\{hint\\}|\\{hint\\}\\n|\\{hint\\}\\s/i', '', $form->fieldConfig['template']); } for ($i = 1; $i != count($keys); $i++) { $button = Html::a(Html::tag('span', '', ['class' => 'glyphicon glyphicon-minus']), array_merge((array) $this->urlRemove, ['id' => $this->models[$i]->{$this->primaryKey}]), $this->buttonOptions); echo $this->field($form, $this->models[$keys[$i]], "[{$keys[$i]}]{$this->attribute}", $button); } if ($this->form->enableClientScript) { $dfClientOptions = []; for ($i = 0; $i != count($form->attributes); $i++) { if (strpos($form->attributes[$i]['name'], $this->attribute) !== false) { $dfClientOptions[] = $form->attributes[$i]; } } $dfClientOptions = Json::encode($dfClientOptions); $formClientOptions = Json::encode($this->form->attributes); $js = <<<JS (function(\$) { var dfClientOptions = {$dfClientOptions}, \$form = \$('#{$this->form->id}'); \$form.yiiActiveForm('data').attributes = {$formClientOptions}; for (var i = 0; i != dfClientOptions.length; i++) { \$form.yiiActiveForm('add', dfClientOptions[i]); } }(jQuery)); JS; $this->view->registerJs($js, View::POS_LOAD); } Pjax::end(); }
</div> </div> --> <!--/discount panel end--> </div> </div> <!--right column--> <div class="col-lg-9 col-md-9 col-sm-12"> <div class="w100 clearfix category-top"> <?php echo Html::tag('h2', $this->title); ?> <div class="categoryImage"> <img src="/images/site/category.jpg" class="img-responsive" alt="img"> </div> </div> <?php Pjax::begin(); ?> <?php echo ListView::widget(['options' => ['id' => 'product-listview'], 'layout' => $template, 'dataProvider' => $dataProvider, 'itemOptions' => ['class' => 'item col-lg-3 col-md-3 col-sm-6 col-xs-12'], 'itemView' => function ($model, $key, $index, $widget) { return $this->render('_product_item', ['model' => $model]); }, 'summaryOptions' => ['class' => 'pull-left']]); ?> <?php Pjax::end(); ?> <!--/.categoryFooter--> </div>
/** * Render Bootstrap Modal * @return ExplorerInput $this */ protected function renderModal() { $modalFooter = Html::button(Yii::t('main', 'Close'), ['class' => 'btn btn-default btn-close']) . Html::button(Yii::t('main', 'Select'), ['class' => 'btn btn-primary btn-select']); Modal::begin(['header' => "<h4>{$this->modalTitle}</h4>", 'id' => $this->options['id'] . $this->postfix, 'options' => ['class' => 'explorer-modal'], 'footer' => $modalFooter]); Pjax::begin(['enablePushState' => false]); echo $this->getBreadcrumbs(); echo $this->getGrid(); Pjax::end(); Modal::end(); return $this; }