syncfusion / ej2-vue-ui-components

Syncfusion Vue UI component library offer more than 50+ cross-browser, responsive, and lightweight vue UI controls for building modern web applications.
https://www.syncfusion.com/vue-ui-components
Other
298 stars 65 forks source link

How to get ExcelFilterBase property from args in actionBegin function? #76

Closed meidikawardana closed 2 years ago

meidikawardana commented 3 years ago

Hi, I'm using this package "@syncfusion/ej2-vue-grids": "^19.2.59",,

And I want solve to this issue in my code: https://www.syncfusion.com/forums/155673/grid-excel-filter-type-omitting-lots-of-distinct-values

This is my actionBegin function:

image

so I inspected the args parameter in actionBegin function. I found out that there is actually a property in args object named filterModel, and inside filterModel there is itemsCnt property:

image

But I cannot get the itemsCnt as you can see in the first image above, it is either undefined or error happened which stops the web app from running properly. It is different than usual javascript object. filterModel has a "type" of ExcelFilterBase and I cannot get filterModel property because I don't know how to access an instance of ExcelFilterBase.

My goal is only to get itemsCnt inside the filterModel object. how I can do that?

Thanks for any help.

rajapandiyan172 commented 3 years ago

Hi Meidikawardana,

Thanks for contacting Syncfusion support.

We have validated your query at our end. By default the itemsCnt property is only available in the actionComplete (requestType as filterchoicerequest) event. Because it is calculated based on the response received from the server after the actionBegin event.

actionComplete: https://ej2.syncfusion.com/vue/documentation/api/grid/#actioncomplete

We suggest you to get the itemsCnt value from the actionComplete event. Find the below code example and sample for your reference.


    actionComplete: function(args){
       if (args.requestType == 'filterchoicerequest') {
           console.log(args.filterModel.itemsCnt);
       }
    }

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/vue_grid_excel_itemscnt587171762.zip

Kindly the share the below details to proceed further on this.

  1. Why you want to use the ItemsCnt value in the actionBegin event?
  2. What is your exact requirement, explain in detail?

Regards, Rajapandiyan S