[CLOSED] rowexpand not expand all nested grid when expand at the first time

  1. #1

    [CLOSED] rowexpand not expand all nested grid when expand at the first time

    hi,team
    please see the video
    http://screencast.com/t/SXSYnQbix94C
    when click the second nested "+" at the first time, the gridpanel not expand all ,so the last row can not be seen , but secondly click "+" , it expanded all, the last row can be seen .
    I create the gridpanel in code behind ,
            [DirectMethod]
            public string GetGrid1(Dictionary<string, string> parameters)
            {
                string vouchId = parameters["vouchId"];
                //根据vouchId查Cwzz_AccVouchSub
                var accVouchSubList = accVouchSubService.GetByVouchId1(int.Parse(vouchId));
    
                var m = new Model { IDProperty = "SerialID" };
                m.Fields.Add(new ModelField { Name = "SerialID" });
                m.Fields.Add(new ModelField { Name = "VouchId" });
                m.Fields.Add(new ModelField { Name = "Digest" });
                m.Fields.Add(new ModelField { Name = "Ccode" });
                m.Fields.Add(new ModelField { Name = "Cname", Type = ModelFieldType.Object, ServerMapping = "Cwzz_AccCode.CClass" });
                m.Fields.Add(new ModelField { Name = "Jfje" });
                m.Fields.Add(new ModelField { Name = "Dfje" });
                m.Fields.Add(new ModelField { Name = "Bill", Type = ModelFieldType.Object, ServerMapping = "Cwzz_AccVouchMain.Bill" });
                m.Fields.Add(new ModelField { Name = "Checker", Type = ModelFieldType.Object, ServerMapping = "Cwzz_AccVouchMain.Checker" });
                m.Fields.Add(new ModelField { Name = "Book", Type = ModelFieldType.Object, ServerMapping = "Cwzz_AccVouchMain.Book" });
                m.Fields.Add(new ModelField { Name = "VouchSource", Type = ModelFieldType.Object, ServerMapping = "Cwzz_AccVouchMain.VouchSource" });
                var store = new Store { DataSource = accVouchSubList };
                store.Model.Add(m);
                store.DataBind();
                var grid = new GridPanel(); 
                grid.ColumnModel.Add(new SummaryColumn { DataIndex = "Digest", Text = "摘要", Flex = 1,SummaryType = SummaryType.None,SummaryRenderer = {Handler = "return '合计:';"}});
                grid.ColumnModel.Add(new Column { DataIndex = "Ccode", Text = "科目编码" });
                grid.ColumnModel.Add(new Column { DataIndex = "Cname", Text = "科目名称" });
                grid.ColumnModel.Add(new SummaryColumn { DataIndex = "Jfje", Text = "借方金额",SummaryType = SummaryType.Sum});
                grid.ColumnModel.Add(new SummaryColumn { DataIndex = "Dfje", Text = "贷方金额",SummaryType = SummaryType.Sum});
                grid.ColumnModel.Add(new Column { DataIndex = "Bill", Text = "制单" });
                grid.ColumnModel.Add(new Column { DataIndex = "Checker", Text = "审核" });
                grid.ColumnModel.Add(new Column { DataIndex = "Book", Text = "记账" });
                grid.ColumnModel.Add(new Column { DataIndex = "VouchSource", Text = "凭证来源" });
                grid.Store.Add(store);
                var re = new RowExpander
                    {
                        Loader = new ComponentLoader
                            {
                                Mode = LoadMode.Component,
                                DirectMethod = "#{DirectMethods}.GetGrid2"
                            }
                    };
                var s = new Ext.Net.Summary { ID = "Summary1" }; 
                grid.Plugins.Add(re);
                grid.Features.Add(s);
                return ComponentLoader.ToConfig(grid);
    
            }
            [DirectMethod]
            public string GetGrid(Dictionary<string, string> parameters)
            {
                string date = parameters["date"];
                var ll = accVouchMainService.GetByDdate(date);
                var data1 = ll.Select(v => new { vouchId = v.VouchId, pzzh = v.VouchClassCode.Trim() + "-" + StringHelper.CompStr(v.VouchNo.ToString(), "0", 4) });
                var grid = new GridPanel
                {
                    Store = 
                { 
                    new Store 
                    { 
                        Model = {
                            new Model {
                                IDProperty = "vouchId",
                                Fields = 
                                {
                                    new ModelField("vouchId"),
                                    new ModelField("pzzh") 
                                }
                            }
                        },
                        DataSource = data1
                    }
                },
                    ColumnModel =
                    {
                        Columns = 
                        { 
                            new Column { Text = "凭证字号", DataIndex = "pzzh",Flex = 1}
                        }
                    },
                    Plugins =
                        {
                            new RowExpander
                                {
                                    Loader = new ComponentLoader
                                        {
                                            Mode  = LoadMode.Component,
                                            DirectMethod = "#{DirectMethods}.GetGrid1" ,
                                              LoadMask=
                                                {
                                                    ShowMask = true
                                                },
                                                 Params=
                                                 {
                                                     new Ext.Net.Parameter
                                                         {
                                                             Name = "vouchId",   
                                                             Value = "this.record.data.vouchId",
                                                             Mode = ParameterMode.Raw
                                                         }
                                                 }
                                        } 
                                }
                        }
                };
    
                return ComponentLoader.ToConfig(grid);
            }
    what's wrong? i want to expand the gridpanel fully so that the last row also can be seen at the first time when i click the "+"
    Last edited by Daniil; Oct 30, 2013 at 3:28 AM. Reason: [CLOSED]
  2. #2
    Hi @tobros,

    If I correctly understand, here was a similar request.
    http://forums.ext.net/showthread.php?26731
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @tobros,

    If I correctly understand, here was a similar request.
    http://forums.ext.net/showthread.php?26731
    thank you,resolved.

Similar Threads

  1. Replies: 1
    Last Post: Mar 13, 2012, 8:37 AM
  2. How to expand the column to occupy the whole grid?
    By ascsolutions in forum 1.x Help
    Replies: 1
    Last Post: Feb 28, 2012, 10:40 PM
  3. Replies: 6
    Last Post: Jan 28, 2012, 1:14 AM
  4. [CLOSED] MouseOver Grid, Expand Row
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 13, 2011, 4:28 PM
  5. [CLOSED] Expand one treenode at a time
    By dnguyen in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 28, 2010, 9:24 PM

Posting Permissions