ngduc / react-tabulator

React Tabulator is based on tabulator - a JS table library with many advanced features.
https://codesandbox.io/s/0mwpy612xw?module=/src/components/Home.js
MIT License
366 stars 84 forks source link

Exception: getComponent is not a function #200

Closed h-tendy closed 4 years ago

h-tendy commented 4 years ago

Hi Oli - I'm using the latest react-tabulator along with the latest tabulator-tables. I have setup the table to use a rowFormatter. With this setup, when I try to copy the table to the clipboard, I get an exception that getComponent is not a function.

I traced this down to js/modules/export.js: line 548. (Confirmed by making this fix locally). Just replace row.getComponent() to row.component. Please confirm and get this fixed?

Appreciate it and thanks.

$ git diff src/js/modules/export.js
diff --git a/src/js/modules/export.js b/src/js/modules/export.js
index c9ab8253..2d947613 100644
--- a/src/js/modules/export.js
+++ b/src/js/modules/export.js
@@ -545,7 +545,7 @@ Export.prototype.genereateRowElement = function(row, setup, styles){
                        }

                        if(setup.rowFormatter && this.config.formatCells !== false){
-                               var rowComponent = row.getComponent();
+                               var rowComponent = row.component;

                                rowComponent.getElement = function(){
                                        return rowEl;
olifolkerd commented 4 years ago

Hey @h-tendy

This issue has already been raised against the core tabulator-tables library, a fix has been pushed to the 4.8 branch which will be released in the next couple of weeks, in the mean time if you need to have that functionality working, using the 4.6 version of Tabulator is recomended

Oli :)

h-tendy commented 4 years ago

That's super. Thanks for the quick response. I'll remember to check the tabulator-tables github page as well.