|
@@ -17,22 +17,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
|
|
|
var table = $("#table");
|
|
|
|
|
|
+ table.on('post-body.bs.table', function (e, settings, json, xhr) {
|
|
|
+ $(".btn-answer").data("area", ["80%", "80%"]);
|
|
|
+ });
|
|
|
+
|
|
|
// 初始化表格
|
|
|
table.bootstrapTable({
|
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
|
|
pk: 'id',
|
|
|
sortName: 'id',
|
|
|
sortOrder: 'desc',
|
|
|
+ search: false,
|
|
|
columns: [
|
|
|
[
|
|
|
{checkbox: true},
|
|
|
{field: 'id', title: __('Id')},
|
|
|
|
|
|
{field: 'user_id', title: __('User_id')},
|
|
|
- {field: 'user.username', title: __('User.username'), operate: 'LIKE'},
|
|
|
+ // {field: 'user.username', title: __('User.username'), operate: 'LIKE'},
|
|
|
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
|
|
{field: 'content', title: __('Content'), operate: 'LIKE',
|
|
|
- cellStyle: {css: {
|
|
|
+ /*cellStyle: {css: {
|
|
|
"white-space": "break-spaces",
|
|
|
"max-width": "200px",
|
|
|
"min-width": "200px",
|
|
@@ -40,7 +45,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
"text-overflow": "inherit",
|
|
|
"overflow": "visible",
|
|
|
}
|
|
|
- }
|
|
|
+ },*/
|
|
|
+ table: table, class: 'autocontent', formatter: Table.api.formatter.content
|
|
|
},
|
|
|
{field: 'images', title: __('Images'), operate: false,
|
|
|
cellStyle: {css: {
|
|
@@ -73,7 +79,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
}
|
|
|
},
|
|
|
{field: 'operate', title: __('Operate'), table: table,
|
|
|
+ buttons: [{
|
|
|
+ name: 'answer',
|
|
|
+ text: '查看评论',
|
|
|
+ icon: 'fa fa-list',
|
|
|
+ classname: 'btn btn-info btn-xs btn-answer btn-dialog',
|
|
|
+ url: 'topicdongtaianswer/index/dt_id/{ids}?dialog=1',
|
|
|
|
|
|
+ }],
|
|
|
events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
|
|
]
|
|
|
]
|
|
@@ -89,6 +102,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
edit: function () {
|
|
|
Controller.api.bindevent();
|
|
|
},
|
|
|
+ answer: function () {
|
|
|
+ Controller.api.bindevent();
|
|
|
+ },
|
|
|
api: {
|
|
|
bindevent: function () {
|
|
|
Form.api.bindevent($("form[role=form]"));
|