0

I have implemented an export to excel service in gridx table for a ibm-bpm application. Currently it exports the entire table into an excel sheet. I want to pass only the selected rows from the table into the excel. So far I have tried the below things in the load event handler to get the selected row values:

  1. this.context.binding.get("value").get("listAllSelectedIndices");
  2. this.grid.select.row.getSelected();

There seem to be modules to select rows. Could someone explain me how to implement them? I have implemented the code as shown here: http://www.ibpmcoding.com/2015/02/export-to-excel-in-gridx-table-coach.html

  • What about using `selectedOnly` parameter of args param passed to `exporter.toCVS()`? See docs: http://oria.github.io/gridx/apidoc/#1.3/gridx/support/exporter/toCSV.__CSVExportArgs – andy Mar 20 '18 at 15:06
  • I have implemented the code as shown here: http://www.ibpmcoding.com/2015/02/export-to-excel-in-gridx-table-coach.html....here a exportCSV is defined like this: exportCSV(this.gridx).then(function(dataforexcel){...how do you propose I pass selectedOnly parameter? @andy – Saurabh Jaiswal Mar 21 '18 at 09:43
  • Exactly as gridx documentation says, pass it as attribute of `args` parameters object i.e. `toCSV({onlySelected:true})`. Let me know if it works, then I will make formal answer ;) – andy Mar 21 '18 at 13:52
  • So for latest version 'this.gridx.exporter.toCSV({})' does not work and has to be written 'exportCSV(this.gridx)'...Here I have tried exportCSV(this.gridx({onlySelected:true})), exportCSV(this.gridx.onlySelected) and exportCSV(this.gridx.onlySelected:true)...none of them work. :( – Saurabh Jaiswal Mar 22 '18 at 10:24
  • My overlook of first param, it should be then `toCSV(this.gridx, {onlySelected:true})`. – andy Mar 22 '18 at 11:27
  • I am also not sure why it does not work for you, since version 1.1 gridx has this `selectedOnly` property and `toCSV` method. – andy Mar 22 '18 at 11:37
  • @andy Even the onlySelected:true did not work. Eventually I used the following: `this.gridx.select.row.getSelected(); //to get selected ids this.gridx.store.index //to get the index of selected rows this.gridx.store.data //to get data from the indexed rows` – Saurabh Jaiswal Mar 27 '18 at 06:03

0 Answers0