我搜索了很多并尝试了很多解决方案,但无法解决此问题。
当我打印此网格导航栏时,下拉停止工作。
echo GridView::widget([
'dataProvider'=> $dataProvider,
//'filterModel' => $searchModel,
'pjax'=>true,
'striped'=>true,
'hover'=>true,
'panel'=>[
'type'=>'primary',
//'type'=>GridView::TYPE_PRIMARY,
//'heading'=>'Vacancies' // $heading,
],
'responsive'=>true,
'hover'=>true,
'resizableColumns'=>true,
'persistResize'=>false,
'toolbar'=> [
'{toggleData}',
'{export}',
],
'export'=>[
'FontAwesome'=>true,
'showConfirmAlert' => false,
"messages"=>false ,
'enableFormatter'=>false,
'target'=>['ExportMenu'=>'TARGET_SELF'],
//'asDropdown'=>true,
],
'exportConfig' => [
GridView::EXCEL => [
'label' => 'Excel',
'icon' => $isFa ? 'file-excel-o' : 'floppy-remove',
//'iconOptions' => ['class' => 'text-success'],
'showHeader' => true,
'showPageSummary' => true,
'showFooter' => true,
'showCaption' => true,
'fullExportType'=> 'xlsx',
'filename' => 'Vacancy_Report',
//'alertMsg' => 'The EXCEL export file will be generated for download.',
'options' => 'test11',
//'mime' => 'application/vnd.ms-excel',
'config' => [
'worksheet' => 'ExportWorksheet',
'cssFile' => ''
],
],
],
]);
使用此类
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\jui\DatePicker;
use app\models\CandidateEducation;
use app\models\CandidatePreviousEmployment;
use yii\helpers\ArrayHelper;
use app\models\Department;
use app\models\Track;
use app\models\Vacancy;
use yii\helpers\Url;
use Helpers;
use yii\web\UploadedFile;
use yii\data\Pagination;
use kartik\grid\GridView;
我的导航代码是
<ul class="nav navbar-nav" >
<li role="presentation" class=" <?php if(strpos($q,'/index.php?r=site%2Findex')!== false ){echo 'active'; } ?> "><?= Html::a('Home', ['/site/index'], ['class'=> 'col']) ?></li>
<li role="presentation" <?php if(strpos($q,'/index.php?r=vacancy/index')!== false ){echo "class='active'"; } ?>> <?= Html::a('Vacancy', ['/vacancy'], ['class'=> 'col']) ?></li>
<li role="presentation" <?php if(strpos($q,'/index.php?r=candidate%2Findex')!== false ){echo "class='active'"; } ?>> <?= Html::a('Candidates', ['/candidate/'], ['class'=> 'col']) ?></li>
<li role="presentation" <?php if(strpos($q,'/index.php?r=interviewer%2Findex')!== false ){echo "class='active'"; } ?>> <?= Html::a('Interviewers', ['/interviewer'], ['class'=> 'col']) ?></li>
<li role="presentation" <?php if(strpos($q,'/index.php?r=drive%2Findex')!== false ){echo "class='active'"; } ?>> <?= Html::a('Drives', ['/drive'], ['class'=> 'col']) ?></li>
<li role="presentation" <?php if(strpos($q,'/index.php?r=question-bank')!== false && strpos($q,'/index.php?r=question-bank%2Fset-question-paper')== false ){echo "class='active'"; } ?>> <?= Html::a('Question Bank', ['/question-bank'], ['class'=> 'col']) ?></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" id="defaultNavbar3" href="#"><b>Question Paper</b> <span class="caret"></span></a>
<ul class="dropdown-menu">
<li role="presentation" <?php if(strpos($q,'/index.php?r=question-bank%2Fset-question-paper')!== false ){echo "class='active'"; } ?>> <?= Html::a('Set Question Paper', ['/question-bank/set-question-paper'], ['class'=> 'col']) ?></li>
<li role="presentation" <?php if(strpos($q,'/index.php?r=question-bank%2Fsearch-question-paper')!== false ){echo "class='active'"; } ?>> <?= Html::a('Search Question Paper', ['/question-bank/search-question-paper'], ['class'=> 'col']) ?></li>
</ul>
</li>
<li role="presentation" <?php if(strpos($q,'/index.php?r=offer%2Findex')!== false ){echo "class='active'"; } ?>> <?= Html::a('Offer', ['/offer'], ['class'=> 'col']) ?></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" id="defaultNavbar4" href="#"><b>User Role</b> <span class="caret"></span></a>
<ul class="dropdown-menu">
<li role="presentation" <?php if(strpos($q,'/index.php?r=assignrole%2Findex')!== false ){echo "class='active'"; } ?>> <?= Html::a('Assign Role To User', ['/auth-assignment/index'], ['class'=> 'col']) ?></li>
<li role="presentation" <?php if(strpos($q,'/index.php?r=role%2Findex')!== false ){echo "class='active'"; } ?>> <?= Html::a('Create Role & Permission', ['/auth-item/index'], ['class'=> 'col']) ?></li>
<li role="presentation" <?php if(strpos($q,'/index.php?r=assignpermission%2Findex')!== false ){echo "class='active'"; } ?>> <?= Html::a('Assign Permission To Role', ['/auth-item-child/index'], ['class'=> 'col']) ?></li>
</ul>
</li>
</ul>
请帮忙!