首页 > 其他分享 >fastadmin添加自定义button按钮

fastadmin添加自定义button按钮

时间:2023-03-22 14:58:05浏览次数:31  
标签:自定义 button 添加 fastadmin 按钮 btn 置顶

fastadmin添加自定义button按钮

   

fastadmin添加自定义按钮

1、首先在初始化表格参数配置中添加URL,添加所需要的按钮地址

  2、然后再初始化表格中,这这个位置中添加按钮事件

 

 1 {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
 2                             buttons:[
 3                                 {
 4                                     name:'top',
 5                                     text:'设为置顶',
 6                                     title:'设为置顶',
 7                                     classname: 'btn btn-xs btn-info btn-view btn-ajax',
 8                                     icon: 'fa fa-arrow-up',
 9                                     url: 'comment/top',
10                                     visible:function(row){
11                                         if(row.top_comment===0){
12                                             return true;
13                                         }else{
14                                             return false;
15                                         }
16                                     },
17                                     refresh:true
18                                 },
19                                 {
20                                     name:'unpink',
21                                     text:'取消置顶',
22                                     title:'取消置顶',
23                                     classname: 'btn btn-xs btn-warning btn-view btn-ajax',
24                                     icon: 'fa fa-arrow-down',
25                                     url: 'comment/unpink',
26                                     visible:function(row){
27                                         if(row.top_comment===1){
28                                             return true;
29                                         }else{
30                                             return false;
31                                         }
32                                     },
33                                     refresh:true
34                                 },
35 
36                             ],formatter: Table.api.formatter.operate
37                         }

 

标签:自定义,button,添加,fastadmin,按钮,btn,置顶
From: https://www.cnblogs.com/tomcat2022/p/17243912.html

相关文章