Url::to([ '/goods-attr/create', 'goods_id' => $goods->id, 'origin' => Yii::$app->request->url ]), 'class' => 'btn btn-success js-layer-attr-link', 'title' => Yii::t('common', 'Create Goods Attr'), ]) ?>

'goods-attr-list']) ?> $dataProvider, 'export' => false, 'options' => ['id' => 'attr_list'], 'columns' => [ [ 'class' => 'kartik\grid\CheckboxColumn', 'name' => 'id', ],//复选框列 'name', 'value', // 'created_at:datetime', // 'updated_at:datetime', [ 'class' => 'backend\widgets\grid\PositionColumn', 'attribute' => 'sort' ], [ 'class' => 'common\helpers\DiyActionColumn', 'template' => '{update} {delete}', 'buttons' => [ 'update' => function ($url, $model, $key) { return Html::a(Yii::t('yii', 'Update'), 'javascript:;', [ 'url' => Url::to(['/goods-attr/update', 'id' => $model->id]), 'class' => 'btn btn-success btn-xs js-layer-attr-link', 'title' => Yii::t('common', 'Update Goods Attr'), ]); }, 'delete' => function ($url, $model, $key) { return Html::a('删除', 'javascript:;', [ 'url' => Url::to(['/goods-attr/delete', 'id' => $model->id]), 'class' => 'btn btn-success btn-xs js-attr-del', 'title' => Yii::t('common', '删除商品属性'), ]); }, ], ], ], ]); ?>
{ //表单提交 $.post(link.attr('url'), {}, (res) => { if (res.errcode == 0) { $.modal.notify(res.errmsg, 'success', () => { //移除行 // link.parents('tr').slideUp().remove(); attrPjax(); }); } else { $.modal.error(res.errmsg); } }); }); }); function attrPjax() { location.hash = '#attr'; $.pjax({ url: location.href, container: '#goods-attr-list', timeout: 0 }); } JS; $this->registerJs($js); ?>