searchFormVisible:false,
searchFormTemplate:'countrySearch',
commonSearch:true,
search:false,
<script id="countrySearch" type="text/html">
<!--form表单必须添加form-commsearch这个类-->
<form action="" class="form-commonsearch form-horizontal">
<!-- 自定义搜索表单 -->
123
</form>
</script>
FastAdmin 表单中 使用函数生成radio
{:build_radios('row[gender]', ['1'=>__('Gentleman'), '2'=>__('Lady')], 1);}
{:build_select('row[room_type]', $roomType, null, ['class'=>'form-control selectpicker', 'required'=>'', 'data-live-search'=>"true"])}
FastAdmin selectpage添加默认选项
//如果发送的来源是 Selectpage,则转发到 Selectpage
if ($this->request->request('keyField')) {
$result=$this->selectpage();
//获取JSON数据
$content=json_decode($result->getContent(),true);
//解构
["list"=>$list,"total"=>$total]=$content;
//添加初始默认值
array_unshift($list, ['id'=>0,"classify_name"=>'无']);
//total +1
return json(['list'=>$list,'total'=>$total+1]);
}
FastAdmin自定义按钮
{field: 'operate', title: __('Operate'), table: table,buttons: [{
name: "classify",
text: "会场管理",
classname: 'btn btn-xs btn-success btn-addtabs',
icon: 'fa fa-sitemap',
url:function(row){
return 'hotel/classify?city_code='+row['city_code']+'&city_customized=1';
},
visible:function(row){
console.log(row);
return (row.status && row.hot) ? true : false;
}
}],events: Table.api.events.operate, formatter: Table.api.formatter.operate}