2016-04-29 104 views
-1

我想为'filterModel'配置表单文本。这是我的代码。yii2 gridview:如何为filterModel配置css

GridView::widget([ 
    'dataProvider' => $dataProvider, 
    'filterModel' => $searchModel, 
    'columns' => $gridColumns, 
]) 
+1

只是一个友情提示,您可能需要阅读过此页:[该如何对询问指南(https://stackoverflow.com/help/how-to-ask),所以你始终可以确保您的问题很容易回答并且尽可能清晰。一定要包括你为解决你遇到的问题所做的任何努力,以及当你尝试修复这些问题时发生了什么。另外不要忘记你的显示代码和任何错误信息! –

+0

“config”是什么意思? –

回答

0

以下是GridzView for filterModel的一些选项。 GridView api

/** 
* @var array the HTML attributes for the filter row element. 
* @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. 
*/ 
public $filterRowOptions = ['class' => 'filters']; 
/** 
* @var array the options for rendering the filter error summary. 
* Please refer to [[Html::errorSummary()]] for more details about how to specify the options. 
* @see renderErrors() 
*/ 
public $filterErrorSummaryOptions = ['class' => 'error-summary']; 
/** 
* @var array the options for rendering every filter error message. 
* This is mainly used by [[Html::error()]] when rendering an error message next to every filter input field. 
*/ 
public $filterErrorOptions = ['class' => 'help-block'];