use kartik\helpers\Html; ?> <div id="<?php echo $id; ?> "> <div id="<?php echo $id; ?> -jstree"></div> <?php echo Html::label($selectLabel, $id . '-select', $selectLabelOptions); ?> <?php echo Html::activeDropDownList($model, $flagFieldName, [], $selectOptions); ?> </div> <?php ob_start(); ?> $("#<?php echo $id; ?> -jstree").jstree(<?php echo $options; ?> ).parents('form').eq(0).submit(function() { $('#<?php echo $id; ?>
echo Helper::getBackendGridClass('shop', ShopModule::BACKEND_PRODUCT_GRID, 1); ?> "> <?php BackendWidget::begin(['title' => Yii::t('app', 'Product'), 'icon' => 'shopping-cart', 'footer' => $this->blocks['submit']]); ?> <?php echo $form->field($model, 'active')->widget(\kartik\switchinput\SwitchInput::className()); ?> <?php echo $form->field($model, 'name'); ?> <?php echo $form->field($model, 'price', ['addon' => ['append' => ['content' => Html::activeDropDownList($model, 'currency_id', app\modules\shop\models\Currency::getSelection())]]]); ?> <?php echo $form->field($model, 'old_price'); ?> <?php echo $form->field(app\models\ViewObject::getByModel($model, true), 'view_id')->dropDownList(app\models\View::getAllAsArray()); ?> <?php if (!$model->isNewRecord && is_array($model->relatedProductsArray)) { $data = \yii\helpers\ArrayHelper::map($model->relatedProducts, 'id', 'name'); ?> <?php echo \app\backend\widgets\Select2Ajax::widget(['initialData' => $data, 'form' => $form, 'model' => $model, 'modelAttribute' => 'relatedProductsArray', 'multiple' => true, 'searchUrl' => '/shop/backend-product/ajax-related-product', 'additional' => ['placeholder' => 'Поиск продуктов ...']]);