angularjs - Ng-grid export that calls cell filters -
I am working with a ng-grid and filters are applied in some columns. However, when I export to CSV The values are displayed without filters: A record can be in JSL this way:
{"service_date": "2014-02-10T00: 00: 00.000 Z "," Service_code ":" someJob3 "," price ": 1234.56}
But in the grid it is displayed as:
service Date | Service disk | Price ------------------------------------- Feb 10,2014 | Some job 3 $ 1,234.56
I think when I get a quote for it as if the filter applies but only the CSV plug-in does not call the cell filter, and simply returns the values in the raw form. How can I open the filter? Works with I-Grid (the replacement version of the NG-Grid) and which one solution is detected, and
This plug-in solution is much simpler than the fact that Matt Welch was to develop for NG-Grid 2.0.
You can specify a exporterFieldCallback
in your grid options and then whatever you want col.name
. In the case of my use I had a user ID, for which I needed to cross the reference of the array index. I had made a cell filter for the table, but the exporter was not clearly reflected in the CSV unless I The exporter did not like the callback of the field:
$ scope.gridOptions = {... exporterFieldCallback: function (grid, line, call, input) {if (col.name == ' Account_executive_id '] col.name ==' account_manager_id ') {business To return the manager (input); } And {return input; }}, ...}
Callback requires a grid, row, call and input variables, and then return the values you need to export. Anything inside it can do. It would be nice if you use "displayed in the grid", but it is still a very simple solution, even if it seems to be inappropriate.
Comments
Post a Comment