如何自定义 yii2 gridview 过滤器行?

问题描述

                <?=
                    GridView::widget([
                        'dataProvider' => $dataProvider,'filterModel' => $searchModel,'tableOptions' => ['class' => 'table custom-table-view table-striped table-bordered'],'columns' => [
                            ['class' => 'yii\grid\SerialColumn'],[
                                'label' => 'User name','attribute' => 'name','filterInputoptions' => [
                                    'class' => 'form-control custom-form-control pr-5','placeholder' => 'Search...',],])
                    ?>

这是我正在使用的代码,使用此代码我可以将类添加到其中,这是输出

<table class="table custom-table-view table-striped table-bordered">
    <thead>
      <tr id="w0-filters" class="filters">
        <td>&nbsp;</td>
        <td><input type="text" id="search-name" class="form-control custom-form-control pr-5" name="Search[name]" placeholder="Search..."></td>
     </tr>

但我想要的是

<tr id="w0-filters" class="filters">
  <td>&nbsp;</td>
   <td>
    <div class"my_class">
    <input type="text" id="search-name" class="form-control custom-form-control pr-5" name="Search[name]" placeholder="Search..."><i class="fa fa-user"></i>
  </div>
</td>

如何在输入框外添加 my_class div。?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...