PDA

View Full Version : [CLOSED] MVC Remote Filtering with Header Items as filters



leonardm
Jul 29, 2013, 9:46 PM
Hi,

I have a requirement to allow the user to type in the Grid header items and do the filter/sorting/paging remotely.
Nothing is being done locally as the data sets are potentially very large. I'm also using Buffering/Paging/Infinite Grid.

I have sorting and paging working remotely but don't know how to package the Header filters and pass it to the controller which will pass it to the Repository layer for filtering.

This is ASP.NET MVC 4.5 project.

Please provide some sample code.

Thanks,
Leo

Baidaly
Jul 30, 2013, 12:58 AM
Hello!

Here is a sample of GridFilters Remote in MVC: http://mvc.ext.net/#/GridPanel_Plugins/GridFilters_Remote/

leonardm
Jul 30, 2013, 1:19 AM
Hello!

Here is a sample of GridFilters Remote in MVC.

Didn't get the attachment or anything. Can you please re post?

Baidaly
Jul 30, 2013, 1:22 AM
Sorry, please find the example above.

leonardm
Jul 30, 2013, 1:51 AM
Sorry, please find the example above.

Thanks, but that was not my question.

Look at this example (http://mvc.ext.net/#/GridPanel_MultiHeader/Filter/)http://mvc.ext.net/#/GridPanel_MultiHeader/Filter/

This is the way I want to do my grid filters but using Remote Filters. The Sample is using Local Filters to filter the grid locally.

Can you please help?

Thanks,
Leo

Baidaly
Jul 30, 2013, 2:12 AM
Thank you for clarifications!

It seems that the best option is to use filter method of the Store: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.data.Store-method-filter

Here is the sample of filtering with Infinite Scrolling: http://examples2.ext.net/#/GridPanel/Infinite_Scrolling/Remote_Filter/

Daniil
Jul 30, 2013, 5:40 AM
Hi everybody,

Recently, the new FilterHeader plugin has been implemented in Ext.NET. Seems it is exactly what you are looking for.

An example of remote filtering is here.
trunk\Ext.Net.Examples\Examples\GridPanel\FilterHe ader\Remote\Default.aspx

leonardm
Jul 30, 2013, 6:02 AM
Hi everybody,

Recently, the new FilterHeader plugin has been implemented in Ext.NET. Seems it is exactly what you are looking for.

An example of remote filtering is here.
trunk\Ext.Net.Examples\Examples\GridPanel\FilterHe ader\Remote\Default.aspx

I did look at it and it looks awesome, but will this work with MVC? Or will an MVC version of this example be available in the SVN soon?
I can really use this right now.

Thanks,
Leo

Daniil
Jul 30, 2013, 6:25 AM
It should work with MVC as well. Probably, at some point we will add this example in MVC Examples Explorer, but not right now.

So, you can start to work on that right now without waiting a sample. If you face any trouble, please ask our assistance here.

fredrikl
Jul 25, 2014, 3:32 PM
Hi,

The trouble with using the existing examples in an MVC context (MVC 5 in my case) is that you don't get the FilterHeaderConditions mapped into the StoreRequestParameters. I have hooked the store up with infinite scrolling to an AjaxProxy pointing to "MyControllerAction".
For posterity and lack of a documented example, the following seems to work:


public ActionResult MyControllerAction(StoreRequestParameters parameters)
{
var filterHeaders = new FilterHeaderConditions(this.Request.Params["filterheader"]);
// ...
}

Daniil
Jul 29, 2014, 8:18 PM
Hi @fredrikl,

Welcome to the Ext.NET forums and thank you sharing a solution.