yorl1n / ext.ExportableGrid

Wrapper over ExtJs's grid to make grid exportable.
MIT License
13 stars 7 forks source link

error: view is undefined in generateWorksheets line 458 with lockable grids #5

Closed abenhamdine closed 7 years ago

abenhamdine commented 7 years ago

Hi, and thx for this great module.

Unfortunately, I'm unable to do it work (extjs 6.0.1), I'm running into the following error : image

The culprit is view in line 458, that is undefined : image

If I replace view by this.getView(), it doesn't work either because there's no property features.

The only properties 'features' I found out are : this.getView().normalGrid.features this.getView().normalView.features this.getView().lockedGrid.features this.getView().lockedView.features

Could you provide me some help ? Or ideas ?

FWIW, I'm using a grid that extends another grid that extends ExportableGrid.

Thx in advance.

abenhamdine commented 7 years ago

If I add line 457 :

this.view = this.getView().normalGrid;

the export is working fine, but it seems like a crazy hack...

yorl1n commented 7 years ago

Hi, it looks like you are using a locking grid. And as per discussion here this plugin has problems with locking grids. Unfortunately I haven't had enough time to investigate the problem. Could you please test it without locking features?

abenhamdine commented 7 years ago

ah yes, enableLocking is true. I will test without, and let you know. According to this discussion, I understand that we can handle the api differences by testing enableLocking and get the according view.

yorl1n commented 7 years ago

Just added support of locked grids, could you please test it. Thanks.

abenhamdine commented 7 years ago

It seems to work pretty well 👍 . Thx a lot !!!💃