Paging vs. grouping

Hi guys,

I’m trying to implement the following use case:
I want to have a grid with paging and grouping. That’s ok and works. When I group the elements, I see only the grouping inside the single page. I have to implement a mechanism that deactivate the paging, when the groping feature was used.
I’m using the JSON Action mode.

Hier is my controller:

public ActionResult Table()
{


GridPropertiesModel gridModel = new GridPropertiesModel()
{
Caption = "Orders",
AutoFormat =
Syncfusion.Mvc.Shared.Skins.Office2007Blue,
AllowFiltering = true,
AllowGrouping = true,
AllowPaging = true,
ActionMode = ActionMode.JSON
};


ViewData["GridModel"] = gridModel;

return View();
}

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Table(Syncfusion.Mvc.Grid.PagingParams args)
{
GridPropertiesModel gridModel = findTheGridByID(args.ID);
gridModel.AllowPaging = false;


List data = getList();

return data.AsEnumerable().GridJSONActions();
}

Any ideas how to implement the function findTheGridByID(string id)?

Kind regards,
Petar Raykov



4 Replies

BM Bala Murugan A.S Syncfusion Team March 28, 2012 06:26 AM UTC

Hi Petar Raykov,

Thanks for using Syncfusion Products.

We suggest you to use OnActionBegin ClientSideEvents for your requirement to deactivate paging when grouping is enabled. Please refer the below code snippet.

[Controller]
GridPropertiesModel model = new GridPropertiesModel()
{
Caption = "Orders",
DataSource = OrderRepository.GetAllRecords(),
AutoFormat = Syncfusion.Mvc.Shared.Skins.Office2007Blue,
AllowFiltering = true,
AllowGrouping = true,
AllowPaging = true,
AllowSorting = true,
ActionMode = ActionMode.JSON,

};
model.ClientSideEvents.OnActionBegin = "ActionBegin";

[JavaScript]


For your convenience, we have prepared a simple sample to demonstrate this and the same can be downloaded from the below link.

http://www.syncfusion.com/downloads/Support/DirectTrac/92571/SelectedRows-1798786851.zip

Please try the above sample and let us if you have any concerns.

Regards,
Bala Murugan A.S





PR Petar Raykov March 28, 2012 02:48 PM UTC

Hi,

thank you for your responce. The way you suggested is super. Unfortunately the example (and the code in your post) doesn't work with IE9 and Firefox 11.

When i drag the group to the grouping place 2 POST-requests will be maked:
1. args.requestType == "grouping"
2. args.requestType == "paging"

The first is ok, but the second cuts my result to size of one page.



BM Bala Murugan A.S Syncfusion Team March 29, 2012 04:21 PM UTC

Hi Petar Raykov,

Thanks for the update.

Currently we are working on your query. We will update you within two business days(April 2, 2012).

Please let us know if you have any concerns.

Regards,
Bala Murugan A.S



BM Bala Murugan A.S Syncfusion Team April 5, 2012 12:17 PM UTC

Hi Petar Raykov,

Thanks for your patience.

Sorry for the delay in getting back to you. We suggest you to use the below code in order to resolve your reported issue. Please refer the below code snippet.

[Controller]
model.ClientSideEvents.OnActionBegin = "ActionBegin";
model.ClientSideEvents.OnActionComplete = "ActionComplete";

[JavaScript]

For your convenience, we have modified the sample which was provided earlier and the same can be downloaded from the below link.

sample link: http://www.syncfusion.com/downloads/Support/DirectTrac/General/SelectedRows-1021194118.zip

Please try the above sample and let us know your concerns.

Regards,
Bala Murugan A.S




Loader.
Up arrow icon