使用bootstrap-table, url获取数据,无法排序。
$('#table').bootstrapTable({
url: '/data/tree.json',
method: 'get',
toolbar: '#toolbar',
striped: true,
cache: false,
pagination: true,
sortable: true,
sortOrder: "asc",
sidePagination: "server",
pageNumber: 1,
pageSize: 10,
pageList: [20, 25, 50, 100],
showToggle: true,
showColumns: true,
showRefresh: true,
showFooter: false,
minimumCountColumns: 2,
clickToSelect: true,
height: 500,
uniqueId: "id",
cardView: false,
detailView: false,
columns: [{
checkbox: true
}, {
field: 'id',
title: '菜单ID',
sortable: true
}, {
field: 'name',
title: '菜单名称'
}, {
field: 'parentName',
title: '父级菜单名称'
}, {
field: 'url',
title: '菜单路径'
}, {
field: 'type',
title: '菜单类型'
},{
field: 'description',
title: '菜单描述'
}]; // end columns
}); // end bootstrapTable
自大由小
自小由大
上面两图的数据都没有变化
是不是没设置'sortName'??
docs