javascript - AngularJS ui-grid 获取所有网格数据以供导出

标签 javascript angularjs export-to-excel angular-ui-grid

我需要从 ui-grid 获取所有数据才能将其导出到 Excel。

我知道它已经具有导出功能,包括 pdf、excel 等所有选项。

我需要从我们这边导出它。为此,我需要让所有数据立即在网格上可见。

我无法找到如何从 ui-grid 获取数据。我有多个网格,这就是为什么我无法获取 $scope.gridapi

对此提出建议

最佳答案

我也遇到过类似的情况。 假设我们有两个网格 $scope.workflowGroup 和 $scope.workflowDetails。

您可以获得他们的数据:

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

如果您需要所有选定的数据,

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

希望这有帮助。

关于javascript - AngularJS ui-grid 获取所有网格数据以供导出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38367787/

相关文章:

javascript - 为 ng-repeat 分配唯一值 ID

javascript - Paypal IPN - 在打开 Paypal 网站之前重定向页面

javascript - 如何使用 axios 检测 401 并停止控制台错误

angularjs - 无法加载 PDF 文档 - Angular JS - BLOB

powershell - Export-Csv - 访问路径 'C:\export.csv' 被拒绝

ruby-on-rails - 如何在rails 3中生成excel报告并将其发送到电子邮件

python - 如何在 xlsxwriter Python 中设置整行或整列的格式?

javascript - Electron 应用程序 : Call java jar

javascript - 主干JS : Load more items into a collection

javascript - 使用指令 Controller 进行 Angular 缩小?