在功能按钮区增加一个自定义按钮 - Add(创建课程)
打开展示层(即JD.CRS.Web.Mvc)的\wwwroot\view-resources\Views\Course\Index.js //用以存放Course查询相关脚本
自带按钮已有五个我们再添加一个:
// 自定义按钮 { extend: 'alert', text: '+' //text: '<i class="material-icons">add</i>' }
完整代码
1 //Button 2 buttons: 3 [ 4 {// 自定义按钮 5 extend: 'alert', 6 text: '+' 7 //text: '<i class="material-icons">add</i>' 8 }, 9 { //复制到剪贴板 10 extend: 'copy', 11 text: 'Copy' 12 }, 13 { //导出CSV 14 extend: 'csv', 15 text: 'CSV', 16 bom: true 17 }, 18 { //导出Excel 19 extend: 'excel', 20 text: 'Excel' 21 }, 22 { //导出PDF 23 extend: 'pdf', 24 text: 'PDF' 25 }, 26 { //打印 27 extend: 'print', 28 text: 'Print' 29 //text: '<i class="material-icons">print</i>' 30 } 31 ]