%: func InfoListPjax(infoList []map[string]string, menuList []menu.MenuItem, thead []string, paginator map[string]interface{}, title string, description string, buffer *bytes.Buffer) %>
<%~ "info_pjax.html" %>
<%@ header { %>
<%= title %>
<%= description %>
<% } %>
<%@ menuPart { %>
<% for _, list := range menuList { %>
<%+ "sidebar.html" %>
<% } %>
<% } %>
<%@ newUrl { %>
<% } %>
<%@ thead { %>
|
<% for _, head := range thead { %>
<%= head %>
|
<% } %>
操作 |
<% } %>
<%@ list { %>
<% for _, info := range infoList { %>
|
|
<% for _, head := range thead { %>
<%==s info[head] %> |
<% } %>
|
<% } %>
<% } %>
<%@ deletePart { %>
$.ajax({
method: 'post',
url: '<%= paginator["delete_url"].(string) %>',
data: {
id: id
},
success: function (data) {
$.pjax.reload('#pjax-container');
if (typeof data === 'object') {
if (data.status) {
swal(data.message, '', 'success');
} else {
swal(data.message, '', 'error');
}
}
},
error: function (data) {
swal("删除失败", '', 'error');
}
});
<% } %>
<%@ footer { %>
<% } %>