|
@@ -34,10 +34,54 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
{field: 'name', title: __('Name')},
|
|
|
{field: 'name_eng', title: __('Name_eng')},
|
|
|
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
|
|
- {field: 'title1', title: __('Title1')},
|
|
|
- {field: 'mobile1', title: __('Mobile1')},
|
|
|
- {field: 'title2', title: __('Title2')},
|
|
|
- {field: 'mobile2', title: __('Mobile2')},
|
|
|
+ // {field: 'title1', title: __('Title1')},
|
|
|
+ // {field: 'mobile1', title: __('Mobile1')},
|
|
|
+ // {field: 'title2', title: __('Title2')},
|
|
|
+ // {field: 'mobile2', title: __('Mobile2')},
|
|
|
+ {
|
|
|
+ field: 'buttons',
|
|
|
+ width: "120px",
|
|
|
+ title: __('按钮组'),
|
|
|
+ table: table,
|
|
|
+ events: Table.api.events.operate,
|
|
|
+ buttons: [
|
|
|
+ {
|
|
|
+ name: 'detail',
|
|
|
+ text: __('弹出窗口打开'),
|
|
|
+ title: __('弹出窗口打开'),
|
|
|
+ classname: 'btn btn-xs btn-primary btn-dialog',
|
|
|
+ icon: 'fa fa-list',
|
|
|
+ url: 'example/bootstraptable/detail',
|
|
|
+ callback: function (data) {
|
|
|
+ Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
|
|
|
+ },
|
|
|
+ visible: function (row) {
|
|
|
+ //返回true时按钮显示,返回false隐藏
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'ajax',
|
|
|
+ text: __('发送Ajax'),
|
|
|
+ title: __('发送Ajax'),
|
|
|
+ classname: 'btn btn-xs btn-success btn-magic btn-ajax',
|
|
|
+ icon: 'fa fa-magic',
|
|
|
+ url: 'example/bootstraptable/detail',
|
|
|
+ confirm: '确认发送',
|
|
|
+ success: function (data, ret) {
|
|
|
+ Layer.alert(ret.msg + ",返回数据:" + JSON.stringify(data));
|
|
|
+ //如果需要阻止成功提示,则必须使用return false;
|
|
|
+ //return false;
|
|
|
+ },
|
|
|
+ error: function (data, ret) {
|
|
|
+ console.log(data, ret);
|
|
|
+ Layer.alert(ret.msg);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ formatter: Table.api.formatter.buttons
|
|
|
+ },
|
|
|
{field: 'switch', title: __('Switch'), table: table, formatter: Table.api.formatter.toggle},
|
|
|
{field: 'sort', title: __('Sort')},
|
|
|
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|