87,910
社区成员
发帖
与我相关
我的任务
分享
<table style=" text-overflow:ellipsis; " class="table table-condensed"
data-ajax="ajaxRequest"
data-toggle="table"
pageNumber=1
id="componenttable"
data-side-pagination="server"
data-unique-id="pd-id"
data-pagination="true">
<thead style="background-color:#169BD5;color:white;">
<tr>
<th v-for="item in columns" data-field="${item}" class="product_th">${item}</th>
</tr>
</thead>
</table>
var tableVM = new Vue({
el: "#componenttable",
data: {
columns: ["status", "speed","id", "gmt_create", "gmt_modified"],
"table": "mytable"
},
created:function(){
var _self = this;
var url = "/testweb/tablecolumns?table=" + _self.table;
$.get(url, function (data) {
var all_data = JSON.parse(data);
_self.columns = all_data["result"];
});
},
methods: {
}
}
);
function ajaxRequest(params) {
url = "/testweb/tabledata";
$.post(url, {"table": "mytable"}, function (data) {
all_data = JSON.parse(data);
data = all_data["result"];
params.success({total: all_data["count"], rows: data});
$(".sortable").css("padding-right", "15px");
$(".td-text-container").parent().css("text-align", "left");
});
}