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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Excel Filter With BatchDataSource that Requires Additional Parameters

Thread ID:

Created:

Updated:

Platform:

Replies:

125414 Aug 16,2016 01:56 AM UTC Aug 16,2016 04:10 AM UTC ASP.NET MVC 1
loading
Tags: Grid
Jeffrey Stone
Asked On August 16, 2016 01:56 AM UTC

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



Madhu Sudhanan P [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;