Itvisors / mendix-PivotTableWebWidget

Mendix pivot table widget (react)
Other
0 stars 4 forks source link

Error when using Average with DB #18

Closed bsgriggs closed 1 week ago

bsgriggs commented 1 week ago

Hi there, I'm trying to make a simple pivot table using average & database option, and I'm getting the following undefined error. When I switch the cell value action to Count or Display, it looks correct. When this error occurs, nothing is rendered to the UI.

Cannot read properties of undefined (reading 'formatValue') TypeError: Cannot read properties of undefined (reading 'formatValue')
    at s.formatNumericValue (http://localhost:8080/dist/pages/MyFirstModule.Home_Web.js?638652733369877436:175:12128)
    at s.formatValue (http://localhost:8080/dist/pages/MyFirstModule.Home_Web.js?638652733369877436:175:11860)
    at s.createTableCell (http://localhost:8080/dist/pages/MyFirstModule.Home_Web.js?638652733369877436:175:10798)
    at http://localhost:8080/dist/pages/MyFirstModule.Home_Web.js?638652733369877436:175:9311
    at Array.map (<anonymous>)
    at s.createBodyRow (http://localhost:8080/dist/pages/MyFirstModule.Home_Web.js?638652733369877436:175:9298)
    at http://localhost:8080/dist/pages/MyFirstModule.Home_Web.js?638652733369877436:175:9210
    at Array.map (<anonymous>)
    at s.createBodyRows (http://localhost:8080/dist/pages/MyFirstModule.Home_Web.js?638652733369877436:175:9197)
    at s.createTableData (http://localhost:8080/dist/pages/MyFirstModule.Home_Web.js?638652733369877436:175:4777)

Here are my table settings Screenshot 2024-10-23 at 9 46 29 AM Here are my data source details Screenshot 2024-10-23 at 9 46 34 AM

Here you can see the table when Display mode. I added a filter to the data source to only show this specific department and none of the values are undefined as the error claims. (This is all fake data made with Mockaroo by the way) Screenshot 2024-10-23 at 9 46 20 AM

mgroeneweg commented 1 week ago

It seems like it cannot find mx.parser. Are you running with React Client enabled?

mgroeneweg commented 1 week ago

Please have a look at the demo: https://testpivottablewebwidget-sandbox.mxapps.io/

It can be found in the Marketplace here: https://marketplace.mendix.com/link/component/115965

bsgriggs commented 1 week ago

Yes, I was using react client.

mgroeneweg commented 1 week ago

I received word from Mendix that the parser is not yet available in React client. This will be fixed. For now, my widget is not compatible with React client as it relies on the mx parser function. As I cannot fix this and it only means to wait for the fix to be provided by Mendix I will close this issue.