May 25, 2012, 6:14 AM
[CLOSED] [Razor] Paging without Store Proxy
I have a form panel which submits the form to a controller method via a direct event and loads the store for a grid panel
pn.Add(Html.X().FormPanel()
.Region(Region.North)
.Collapsible(true)
.Title("Enter Search Criteria")
.BodyPadding(4)
.Layout(LayoutType.Column)
.MaxHeight(600)
.ID("pnlSearchForm")
.Buttons(buttons =>
{
buttons.Add(Html.X().Button()
.DirectEvents(directEvents =>
{
directEvents.Click.ExtraParams.Add(new Parameter("start","0", ParameterMode.Raw));
directEvents.Click.ExtraParams.Add(new Parameter("limit", "30", ParameterMode.Raw));
directEvents.Click.Url = "/Services/Search";
directEvents.Click.Success = "#{store1}.loadData(result.extraParamsResponse.data); #{pnlSearchForm}.collapse(true)";
})
.Text("Search"));
}
The controller method (/Services/Search) basically returns an AjaxResult as follows as I was told StoreResult would not work in this case:AjaxResult r = new AjaxResult()
{
ExtraParamsResponse =
{
new Parameter()
{
Name = "data",
Value = JSON.Serialize(gridResults),
Mode = ParameterMode.Raw
}
}
};
return r;
My issue is that I now need to add paging to the gridpanel and when I add a paging toolbar to the gridpanel it doesn't appear. I suspect this is because the AjaxResult I'm returning and loading directly into the store has no idea what the total count is and/or there is other data that the store expects for paging that are not available? How can I go about paging in my case?
Last edited by Daniil; Jun 04, 2012 at 7:41 AM.
Reason: [CLOSED]