【发布时间】:2026-01-13 18:55:01
【问题描述】:
我正在使用 angularjs mudule 智能表。
我的表有服务器端处理,所有数据加载都位于服务器上。我想在表格之外有一个刷新按钮。
这是调用服务器的函数,我希望能够手动调用它,但我不知道如何在我的控制器中检索表状态。
this.callServer = function callServer(tableState) {
ctrl.isLoading = true;
var pagination = tableState.pagination;
var start = pagination.start || 0; // This is NOT the page number, but the index of item in the list that you want to use to display the table.
var number = pagination.number || 10; // Number of entries showed per page.
service.getPage(start, number, tableState, ctrl.startDateFilter,
ctrl.endDateFilter).then(function (result) {
ctrl.displayed = result.data;
tableState.pagination.numberOfPages = result.numberOfPages;
ctrl.isLoading = false;
});
};
我的目标是有一个这样的功能,我怎样才能得到表格状态?
this.refreshTable = function(){
tableState = getTableState();
ctrl.callServer(tableState);
}
【问题讨论】:
标签: angularjs ajax smart-table