We get the following error when trying to use Vue 3.0 Pivot Table. Also, can someone please provide us with this latest Vue 3.0 documentation?
Uncaught TypeError: Object prototype may only be an Object or null: undefined
at setPrototypeOf (<anonymous>)
at extendStatics (webpack:///./node_modules/@syncfusion/ej2-vue-base/src/component-base.js?:19)
at __extends (webpack:///./node_modules/@syncfusion/ej2-vue-base/src/component-base.js?:22)
at eval (webpack:///./node_modules/@syncfusion/ej2-vue-base/src/component-base.js?:59)
at eval (webpack:///./node_modules/@syncfusion/ej2-vue-base/src/component-base.js?:446)
at Module../node_modules/@syncfusion/ej2-vue-base/src/component-base.js (app-vue.js:8401)
at __webpack_require__ (app-vue.js:20)
at eval (webpack:///./node_modules/@syncfusion/ej2-vue-base/src/index.js?:2)
at Module../node_modules/@syncfusion/ej2-vue-base/src/index.js (app-vue.js:8425)
at __webpack_require__ (app-vue.js:20)
Hi Manikandan,
Thank you for your reply.
We have gone through the sample code that you provided in the previous reply, and do some changes in our applications so now the pivot table is loading fine.
But we are getting the below error:
pivotview.js:2424 Uncaught TypeError: Cannot read property 'fieldListSpinnerElement' of undefined
at Proxy.PivotView.onContentReady (pivotview.js:2424)
at Proxy.Observer.notify (observer.js:102)
at Proxy.Component.notify (component.js:263)
at Proxy.Render.dataBound (render.js:318)
at Proxy.Observer.notify (observer.js:102)
at Proxy.Base.trigger (base.js:188)
at eval (content-renderer.js:84)
at eval (util.js:162)
webpack:///./node_modules/@syncfusion/ej2-pivotview/src/pivotview/base/pivotview.js?
above file.
Are we missing something here ?
Thank you in advance
Madhu
|
export default {
name: "App",
components: {
"ejs-pivotview": PivotViewComponent
},
provide: {pivotview: [FieldList,
GroupingBar,
CalculatedField]},
};
|
Hi Manikandan,
Thanks for the quick reply.
We are injecting the FieldList module into the pivot table, then also we are the same error.
You are right we removed that FieldList module from the pivot table (From your sample code) and the error reproduced in your code as well.
So I am wondering why in my application we are getting this error.
Here I am sending you my project's pivot.vue file.
We are using the same pivot version that we have in your sample application.
Please find the attached pivot zip file for more reference.
Thanks in advance :)
Regards,
Madhu
|
export default {
name: 'App',
components: {
"ejs-pivotview": PivotViewComponent
},
provide: {pivotview: [FieldList,
CalculatedField]},
}
|
Hi Manikandan,
Even applying the "name" parameter is not working, I guess the issue is because of routing. We are calling the pivot page by using the routing path and after that it is not working.
I have also reproduced this issue in your given code. I have included vue routing library and try to check and in your sample code also it is not working and giving the same error.
I am attaching the sample code here. You run it and browse "http://localhost:8080/pivot-demo" you will see that error.
Let me know if you need any help here.
Regards,
Madhu
|
import { PivotViewComponent, PivotView,Inject, FieldList, CalculatedField } from "@syncfusion/ej2-vue-pivotview";
PivotView.Inject(FieldList, CalculatedField); |
Hi Manikandan,
Thanks for the solution.. It is working fine now. But I guess it's a patch. Let me know when we have a proper solution.
But for now, it is working fine. :)
Thank You,
Madhu
Hi Manikandan,
Here comes another problem with vue3 and routing.
We want to access the toolbar property of the pivot table.
We are following "https://ej2.syncfusion.com/vue/documentation/pivotview/tool-bar/ " link to set it up.
But somehow we are not getting toolbar appeared in our pivot table.
And also we are not getting any error for the same.
I am attaching the source here.
Let me know if you need more information.
Thank You,
|
<ejs-pivotview
v-if="dataSourceSettings.dataSource.length > 0"
:dataSourceSettings="dataSourceSettings"
:height="height"
showFieldList="showFieldList"
class="pd-15"
:allowCalculatedField="allowCalculatedField"
:showToolbar="showToolbar"
:toolbar="toolbar"
>
|
Hi Manikandan,
That works! But apart from that, I did some internal changes in our application to make every option work.
I Will let you know once it's working fine.
Thank You
Madhu
Hello Manikandan,
Facing one issue while fetching pivot reports.
It is working fine when we assign reports array directly to "args.reportName" like "args.reportName = ["Sample Report"]". But the issue comes when we assign it after API call success. So basically it is not working in a callback function.
For reproducing the issue I have put that line in "SetTimeout" So that you can check it.
And what if we want to store the Id of the report with the report name, Is it possible?
Thanks
Madhu
|
updateReport() {
let reportCollection = [];
let reportList = [];
if (
localStorage.pivotviewReports &&
localStorage.pivotviewReports !== ""
) {
reportCollection = JSON.parse(localStorage.pivotviewReports);
}
reportCollection.map(function (item) {
reportList.push(item.reportName);
});
let pivotObj = this.$refs.pivotview.ej2Instances;
// Here you can refresh the report list by feeding updated datsource fetched from your DB.
var reportListObj = document.querySelector(
"#" + pivotObj.element.id + "_reportlist"
).ej2_instances;
if (reportListObj) {
reportListObj[0].dataSource = reportList;
reportListObj[0].value = pivotObj.toolbarModule.currentReport;
}
}, |
Hello Manikandan,
I don't want to put a button and on a click of it get all reports, I want to do it in fetch.
Below is our scenario:
When the page loads fetch event of pivot view will call and it will do one API call to get all report names from the server.
When we get all the reports we are assigning them to pivot view dropdown using "args.reportName = reports". But as it is API call's callback somehow it is not assigning them to dropdown and dropdown remains empty all the time.
So after that i applied your solution and put below
Hello Manikandan,
Don't look into that issue! I have solved it using
Link
Thank You,
Madhu
Hello Manikandan,
I have a question regarding the field list.
Can we not put the same field in the column section or row section as well as in the value section?
Thanks
Ronak
Hi Manikandan,
I achieved that using the onDropChange event of the field list.
I am facing another issue, when I am trying to use the "PercentageOfDifferenceFrom" type in the aggregation value field, I am not getting anything in the "Base Item" dropdown under the "Value field settings" popup. It only shows "Nan" in the dropdown, It should show all the row's labelName I believe.
One more thing you should know is, It is only happening with string type and only in our application.
I have checked in your sample code using our data source it is working fine.
Below is the data source settings:
{"data":{"pivot_name":"Test 4","settings_json":{"dataSource":[],"expandAll":false,"values":[{"name":"Scholarship_Amount","caption":"Scholarship_Amount","baseField":"country","baseItem":"NaN","isCalculatedField":false,"isNamedSet":false,"showNoDataItems":false,"showSubTotals":true,"type":"PercentageOfDifferenceFrom","showFilterIcon":true,"showSortIcon":true,"showRemoveIcon":true,"showValueTypeIcon":true,"showEditIcon":true,"allowDragAndDrop":true}],"filters":[],"formatSettings":[{"name":"Id","format":"","type":"","useGrouping":false},{"name":"Entry_date","format":"","type":"","useGrouping":false},{"name":"Entry_Year","format":"","type":"","useGrouping":false},{"name":"Entry_Month","format":"","type":"","useGrouping":false},{"name":"Entry_Quarter","format":"","type":"","useGrouping":false},{"name":"Entry_Sami_Annual","format":"","type":"","useGrouping":false},{"name":"Beneficiary_Id","format":"","type":"","useGrouping":false},{"name":"id","format":"","type":"","useGrouping":false},{"name":"Applicant_First_Name","format":"","type":"","useGrouping":false},{"name":"Applicant_Last_Name","format":"","type":"","useGrouping":false},{"name":"Duplicated_Applicant_Last_Name","format":"","type":"","useGrouping":false},{"name":"Gender","format":"","type":"","useGrouping":false},{"name":"Status","format":"","type":"","useGrouping":false},{"name":"Aplicant_Email","format":"","type":"","useGrouping":false},{"name":"Duplicated_Aplicant_Email","format":"","type":"","useGrouping":false},{"name":"country","format":"","type":"","useGrouping":false},{"name":"Scholarship_Awarded","format":"","type":"","useGrouping":false},{"name":"Scholarship_Amount","format":"","type":"","useGrouping":false},{"name":"Education_Level","format":"","type":"","useGrouping":false},{"name":"Number","format":"","type":"","useGrouping":false},{"name":"Currency","format":"","type":"","useGrouping":false}],"providerType":"Relational","mode":"Local","type":"JSON","localeIdentifier":1033,"excludeFields":[],"allowLabelFilter":false,"allowValueFilter":false,"allowMemberFilter":true,"enableSorting":true,"rows":[{"name":"country","caption":"country","isCalculatedField":false,"isNamedSet":false,"showNoDataItems":false,"showSubTotals":true,"type":"Count","showFilterIcon":true,"showSortIcon":true,"showRemoveIcon":true,"showValueTypeIcon":true,"showEditIcon":true,"allowDragAndDrop":true}],"columns":[],"filterSettings":[],"sortSettings":[],"drilledMembers":[],"valueSortSettings":{"headerDelimiter":".","sortOrder":"None"},"valueAxis":"column","calculatedFieldSettings":[],"fieldMapping":[],"showSubTotals":true,"showRowSubTotals":true,"showColumnSubTotals":true,"showGrandTotals":true,"showRowGrandTotals":true,"showColumnGrandTotals":true,"showHeaderWhenEmpty":true,"alwaysShowValueHeader":false,"conditionalFormatSettings":[],"groupSettings":[],"showAggregationOnValueField":true,"authentication":{}}}}
Data Source:
Let me know if you need anything else
I am playing with "country" field.
Thank You
Madhu
One Update.. After debugging into pivot js.. we come to know that we are getting the "NaN" object only for all the string fields in "this.parent.engineModule.fieldList"
Here in this image, you can see we are getting "formattedMembers" with only one property that is "NaN" under the country row.
I guess this will help you to find the solution.
Hello Manikandan,
We know that but we have to put that blank string "" intentionally in formatSetting. If we wont put that, it will give below error.
intl-base.js:841 Uncaught TypeError: format.split is not a function
at Object.customFormat (intl-base.js:841)
at Function.NumberParser.numberParser (number-parser.js:43)
at Internationalization.getNumberParser (internationalization.js:133)
at ValueFormatter.getParserFunction (value-formatter.js:31)
at new Column (column.js:153)
at prepareColumns (util.js:414)
at Proxy.Grid.updateColumnObject (grid.js:3986)
at Proxy.Grid.refreshColumns (grid.js:4040)
at Proxy.Render.render (render.js:84)
at Proxy.PivotView.renderPivotGrid (pivotview.js:1707)
And nothing will load in pivot table.
SO for the workaround we passed blank strings for all the columns like below:
"formatSettings":[{"name":"Id","format":"","type":"","useGrouping":false},{"name":"Entry_date","format":"","type":"","useGrouping":false},{"name":"Entry_Year","format":"","type":"","useGrouping":false},{"name":"Entry_Month","format":"","type":"","useGrouping":false},{"name":"Entry_Quarter","format":"","type":"","useGrouping":false},{"name":"Entry_Sami_Annual","format":"","type":"","useGrouping":false},{"name":"Beneficiary_Id","format":"","type":"","useGrouping":false},{"name":"id","format":"","type":"","useGrouping":false},{"name":"Applicant_First_Name","format":"","type":"","useGrouping":false},{"name":"Applicant_Last_Name","format":"","type":"","useGrouping":false},{"name":"Duplicated_Applicant_Last_Name","format":"","type":"","useGrouping":false},{"name":"Gender","format":"","type":"","useGrouping":false},{"name":"Status","format":"","type":"","useGrouping":false},{"name":"Aplicant_Email","format":"","type":"","useGrouping":false},{"name":"Duplicated_Aplicant_Email","format":"","type":"","useGrouping":false},{"name":"country","format":"","type":"","useGrouping":false},{"name":"Scholarship_Awarded","format":"","type":"","useGrouping":false},{"name":"Scholarship_Amount","format":"","type":"","useGrouping":false},{"name":"Education_Level","format":"","type":"","useGrouping":false},{"name":"Number","format":"","type":"","useGrouping":false},{"name":"Currency","format":"","type":"","useGrouping":false}]
And if we pass some format for these columns even though it is giving the same error.
I believe while debugging we come to know that there is some conflict of "format" keyword with JQuery.
So, let us know what we are doing wrong here.
Thank you Manikandan for coming back to us :).
Thanks
Madhu
Hi Manikandan,
Please find attached code. We have reproduced that error in this attached code. Your "format" method is conflicting with one of our jquery file's (jquery.steps.js) "format" method.
Please check it and let me know if you need anything from our end.
Thanks,
Madhu
Hi Manikandan,
This is not the solution to our problem, it is just a patch. We can not modify anything in our JS file, we believe you have to change that function name from your side (in pivot view's files) and provide us a new pivot build?
Thanks,
Madhu