[CLOSED] StartCollapsed in GridPanel and remote paging

  1. #1

    [CLOSED] StartCollapsed in GridPanel and remote paging

    Hello!

    If I use StartCollapsed in GridPanel + Grouping and remote Paging, If change the page, parameter StartCollapsed is reset - false. It is not right.

    Source code

    Index.cshtml
    @using Ext.Net.MVC
    
    @model ICollection<ExtNetTest.Models.StageItemModel>
    
    @{
        ViewBag.Title = "";
        Layout = "~/Views/Shared/_BaseLayout.cshtml";
        var X = Html.X();
    }
    
    @section bodySection
    {
        @(X.Viewport()
              .MinWidth(1245)
              .MinHeight(600)
              .Layout(LayoutType.Border)
              .AutoScroll(true)
              .Items(
                  X.GridPanel()
                      .ID("gpnlCalPlan")
                      .Title("CalPlan")
                      .Region(Region.Center)
                      .Flex(1)
                      .Frame(true)
                      .Store(
                          X.StoreForModel()
                              .Proxy(X.AjaxProxy()
                                  .Url(Url.Action("LoadCalendarPlan"))
                                  .Reader(X.JsonReader().RootProperty("data"))
                                  .ActionMethods(methods => methods.Read = HttpMethod.POST)
                              )
                              .GroupField("CalendarPlanName")
                              .PageSize(3)
                              .RemoteSort(true)
                      )
    
    
                      .ColumnModel(
                          X.Column().DataIndex(Model, m => m.CalendarPlanName).Text("CalPlan").Hidden(true),
                          X.Column().DataIndex(Model, m => m.Name).Text("Stage Name").MinWidth(150).Flex(1)
                      )
                      .BottomBar(
                          X.PagingToolbar()
                      )
                      .View(
                          Html.X().GridView()
                      )
                      .Features(
                          Html.X().Grouping()
                              .ID("grCalendarPlan")
                              .GroupHeaderTplString("{columnName}: {name}")
                              .StartCollapsed(true)
                      )
              ))
    }
    Model
        public class StageItemModel
        {
            public string Name { get; set; }
            public string CalendarPlanName { get; set; }
        }
    Conroller
    public class ExtNetController : Controller
        {
            public ActionResult Index()
            {
                return View();
            }
    
            public ActionResult LoadCalendarPlan(StoreRequestParameters parameters)
            {
                List<StageItemModel> listStage = null;
                //Fictitious separation pages
                if (parameters.Page == 1)
                {
                    listStage = new List<StageItemModel>()
                    {
                        new StageItemModel()
                        {
    
                            CalendarPlanName = "CalPlan 1",
                            Name = "Stage 1"
                        },
                        new StageItemModel()
                        {
                            CalendarPlanName = "CalPlan 1",
                            Name = "Stage 2"
                        },
                        new StageItemModel()
                        {
                            CalendarPlanName = "CalPlan 1",
                            Name = "Stage 3"
                        }
                    };
                }
                else
                {
                    listStage = new List<StageItemModel>()
                    {
                        new StageItemModel()
                        {
                            CalendarPlanName = "CalPlan 2",
                            Name = "Stage 4"
                        },
                        new StageItemModel()
                        {
                            CalendarPlanName = "CalPlan 2",
                            Name = "Stage 5"
                        },
                        new StageItemModel()
                        {
                            CalendarPlanName = "CalPlan 2",
                            Name = "Stage 6"
                        }
                    };
                }
    
                //Fictitious divided by count record
                int countRow = 6;
                return this.Store(new Paging<StageItemModel>(listStage, countRow));
            }
        }
    Last edited by fabricio.murta; May 24, 2016 at 7:46 PM. Reason: no user feedback for 7+ days
  2. #2
    Hello @SuperBolt!

    After investigating it a little, I could find that your problem has already been reported here on the thread: question on grouping state and, unfortunately, has not been fixed yet. Please follow that thread and respective github issue (#780) to be notified when the fix is implemented!

    Thanks for reporting it!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Implementing GridPanel Remote Paging [MVC]
    By ismailkocacan in forum Examples and Extras
    Replies: 1
    Last Post: Aug 31, 2015, 8:01 AM
  2. GridPanel Remote Paging with SqlDatasource
    By Aod47 in forum 1.x Help
    Replies: 1
    Last Post: Oct 25, 2013, 6:00 AM
  3. GridPanel Remote Paging Problem
    By zhangjiagege in forum 1.x Help
    Replies: 6
    Last Post: Nov 22, 2011, 8:17 AM
  4. [CLOSED] GridPanel remote paging issue
    By jskibo in forum 1.x Legacy Premium Help
    Replies: 15
    Last Post: Jan 31, 2011, 8:37 AM
  5. [CLOSED] Remote paging GridPanel
    By idrissb in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 21, 2010, 11:17 AM

Tags for this Thread

Posting Permissions