### 配置項`toolbarRefresh`
> 配置工具欄刷新按鈕
參數`array $options 選項`
> -`title string 按鈕名稱,默認:`
> -`icon string 按鈕圖標,默認: glyphicon glyphicon-refresh`
代碼示例:
~~~
return ViewBuilder::table()
->setTitle('會員列表')
->setPage(true)
->setHideCheckbox(false)
->setRowActions([
table_action_helper('ajax', [
'title' => '解封/封停',
'icon' => 'fa fa-lock',
'route' => 'admin/index/disable',
'params' => ['id', 'status'],
'method' => 'post',
]),
table_action_helper('division', []),
table_action_helper('modal', [
'title' => '編輯',
'icon' => 'fa fa-pencil-square-o',
'route' => 'admin/index/edit',
'width' => '60%',
'height' => '80%',
]),
table_action_helper('page', [
'title' => '新增',
'icon' => 'fa fa-plus',
'route' => 'admin/index/add',
]),
])
->setToolbarRefresh()
->setColumns([
'password',
'username' => table_column_helper('用戶名', ['style' => ['min-width' => '100px']]),
'an_mobile' => table_column_helper('電話', ['style' => ['min-width' => '100px']], function($item){
return '+' . $item['an'] . ' ' . $item['mobile'];
}),
'email' => table_column_helper('郵箱', ['style' => ['min-width' => '200px']]),
])
->setQuery(function () {
$query = AdminUser::find()->select(['id', 'username', 'password', 'email', 'an', 'mobile', 'status']);
return $query;
})
->setOrderBy('id DESC')
->setPrimaryKey('id')
->render($this);
~~~
示例圖示:
