We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Grid Excel Filter With BatchDataSource that Requires Additional Parameters

I have a grid with the filter settings defined as:

.FilterSettings(filter => { filter.FilterType(FilterType.Excel); })

I have defined the datasource as follows and it requires three additional parameters.

.Datasource(ds => ds.URL(Url.Action("BatchDataSource", "BacktestResult")).BatchURL(Url.Action("BatchUpdate", "BacktestResult")).Adaptor(AdaptorType.UrlAdaptor))
.Query("new ej.Query().addParams('type','').addParams('id','0').addParams('numberOfTopResults','0')")

When clicking on a columns filter drop down button the dialog displays; however, the hourglass never disappears and no values appear.
I can see that there is a request going to my controller that has a status of 500 - because it is not specifying any of the additional parameters.

How can I get this to work with the additional parameters?

Regards Jeff



1 Reply

MS Madhu Sudhanan P Syncfusion Team August 16, 2016 04:10 AM UTC

 
Thanks for contacting Syncfusion support. 
 
The Excel filter uses individual query regardless of Grid and hence to send the additional parameter when using excel filter, register the ActionBegin client side event and add the params to the excel filter query as follows. 
   
 
@(Html.EJ().Grid<object>("Grid") 
            . . . . . . 
 
            .ClientSideEvents(evt => evt.ActionBegin("onActionBegin")) 
) 
 
<script> 
function onActionBegin(e) { 
         if (e.requestType === "filterchoicerequest") 
         e.query.addParams('type', '').addParams('id', '0').addParams('numberOfTopResults', '0'); 
} 
</script> 
 
Please refer to the below help link. 
 
 
Please let us know If you have any queries. 
 
Regards, 
Madhu Sudhanan P 


Loader.
Live Chat Icon For mobile
Up arrow icon