PDA

View Full Version : [CLOSED] rowexpand not expand all nested grid when expand at the first time



tobros
Oct 29, 2013, 8:42 AM
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 "+"

Daniil
Oct 29, 2013, 11:32 AM
Hi @tobros,

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

tobros
Oct 30, 2013, 2:44 AM
Hi @tobros,

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

thank you,resolved.