简体   繁体   English

AngularJS ui-grid获取所有要导出的网格数据

[英]AngularJS ui-grid Get All grid data for Export

I need to have all data from ui-grid for exporting it to excel. 我需要将ui-grid所有数据导出到excel。

I know it has already export function with all options like pdf, excel etc. 我知道它已经具有pdf,excel等所有选项的导出功能。

I have a requirement to export it from our side. 我需要从我们这边导出它。 for that I need to have all data visible right now on grid. 为此,我需要立即在网格上显示所有数据。

I am not able to find out how to take data from ui-grid. 我无法找出如何从ui-grid中获取数据。 I have multiple grids that's why I am not able to get $scope.gridapi 我有多个网格,这就是为什么我无法获得$scope.gridapi

suggest something on this 在此提出一些建议

I faced the similar situation. 我也遇到过类似的情况。 Lets assume we have two grids $scope.workflowGroup and $scope.workflowDetails. 假设我们有两个网格$ scope.workflowGroup和$ scope.workflowDetails。

you can get their data: 您可以获取他们的数据:

$scope.workflowGroup.data
$scope.workflowDetails.data

In case you need all the selected data, 如果您需要所有选定的数据,

$scope.filteredRows = $scope.gridApi.core.getVisibleRows($scope.gridApi.workflowGroup);

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM