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.
Unfortunately, activation email could not send to your email. Please try again.

Grid Excel Filter With BatchDataSource that Requires Additional Parameters

Thread ID:

Created:

Updated:

Platform:

Replies:

125414 Aug 15,2016 09:56 PM Aug 16,2016 12:10 AM ASP.NET MVC 1
loading
Tags: Grid
Jeffrey Stone
Asked On August 15, 2016 09:56 PM

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 12:10 AM

 
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.

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.

;