使用外部分页和导出数据的UI网格 [英] ui-grid using external Pagination and exporting data
本文介绍了使用外部分页和导出数据的UI网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前使用的与外部实现分页UI格来显示我的数据。我碰到的问题,在这里我只能导出当前查看的数据,但我需要能够将所有数据导出为好。
I am currently using ui-grid implemented with external pagination to display my data. I've run into as issue where I can only export the currently viewed data, however I need to be able to export ALL data as well.
任何人都知道一个变通使用外部分页导出所有数据?
Anyone know a work around to export all data using external pagination?
推荐答案
我最终使用csvExport功能包括UI的网格。我添加了一个导出全部自定义菜单项和它的伟大工程!这里是我的code:
I ended up using csvExport function included with ui-grid. I added an "Export All" custom menu item and it works great! Here is my code:
gridMenuCustomItems: [
{
title: 'Export All',
action: function ($event) {
$http.get(url).success(function(data) {
$scope.gridOptions.totalItems = data.totalFeatures;
$scope.gridOptions.data = data.features;
$timeout(function()
{
var myElement = angular.element(document.querySelectorAll(".custom-csv-link-location"));
$scope.gridApi.exporter.csvExport( uiGridExporterConstants.ALL, uiGridExporterConstants.ALL, myElement );
}, 1000);
});
}
}
]
希望这可以帮助别人!
Hope this helps someone!
这篇关于使用外部分页和导出数据的UI网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文