三石大大: 请帮忙看下合计行问题
测试环境:
http://fineui.com/bbs/forum.php? ... 2123&extra=page%3D1
下载的EmptyProjectNet40_FineUI_v4.1.1.zip包。
web代码:
- <f:PageManager ID="PageManager1" runat="server" />
- <f:Grid ID="Grid1" runat="server" AllowSorting="True" Title="Grid" <font color="#ff0000">EnableSummary ="true" SummaryPosition ="Top" </font> >
- <Columns>
- <f:BoundField DataField ="Name" SortField ="Name" ID ="Name" HeaderText ="Name"/>
- <f:BoundField DataField ="BlogId" SortField ="BlogId" ID ="BlogId" HeaderText ="BlogId"/>
- </Columns>
- </f:Grid>
复制代码 CS代码:
- using (var db = new BlogContext())
- {
- var query = from b in db.Blogs
- orderby b.Name
- select b;
- Grid1.RecordCount = 20;
- Grid1.DataSource = query;
- Grid1.DataBind();
- <font color="#ff0000"> JObject summary = new JObject();
- summary.Add("BlogId", 100);
- summary.Add("Name", "合计");
- Grid1.SummaryData = summary;</font>
- }
复制代码
查看源文件:<script type="text/javascript">
//<![CDATA[
if(!F&&!Ext){if(confirm('ERROR: extjs folder is lost, download it now?')){window.location.href='http://fineui.com/bbs/forum.php?mod=viewthread&tid=3218';}}Ext.onReady(function(){F.util.init('side',100,':','/extjs/res/s.gif',true,'default',true,'neptune');F.pagemanager={name:"ageManager1"};var f2={f_state:{},id:"Grid1_Name",text:"Name",sortable:true,dataIndex:"Grid1_Name",f_columnIndex:0,menuDisabled:false,hideable:true,summaryType:F.util.summaryType('Grid1')};var f3={f_state:{},id:"Grid1_BlogId",text:"BlogId",sortable:true,dataIndex:"Grid1_BlogId",f_columnIndex:1,menuDisabled:false,hideable:true,summaryType:F.util.summaryType('Grid1')};var f1_state={"RecordCount":6,"SummaryData":{"BlogId":100,"Name":"合计"},"F_Rows":{"Values":[["jim","1"],["jim","3"],["jim","5"],["rainbow","6"],["rainbow","4"],["rainbow","2"]],"DataKeys":[[null],[null],[null],[null],[null],[null]],"States":[[],[],[],[],[],[]]}};var f1_selModel=Ext.create('Ext.selection.RowModel',{mode:"MULTI"});var f1_fields=[{name:"Grid1_Name"},{name:"Grid1_BlogId"}];var f1_store=Ext.create('Ext.data.ArrayStore',{fields:f1_fields,remoteSort:true,listeners:{beforeload:function(store,operation){var sorter=operation.sorters[0];if(sorter){__doPostBack('Grid1','Sort$'+sorter.property+'$'+sorter.direction);}return false;}}});var f1_columns=[f2,f3];var f1=Ext.create('Ext.grid.Panel',{f_state:f1_state,id:"Grid1",renderTo:"Grid1_wrapper",bodyStyle:"",border:true,animCollapse:false,collapsible:false,collapsed:false,title:"Grid",selModel:f1_selModel,columns:f1_columns,store:f1_store,f_fields:f1_fields,viewConfig:{getRowClass:function(){return 'f-grid-row';}},draggable:false,enableColumnMove:false,enableDragDrop:false,features:[{ftype:"summary",id:"summary",dock:"top"}],enableLocking:false,listeners:{afterrender:function(cmp){window.setTimeout(function(){cmp.f_initSortHeaders();cmp.f_selectRows();},200);},render:function(cmp){cmp.f_loadData();}}});var f4=Ext.create('Ext.button.Button',{f_state:{},id:"btnHello",renderTo:"btnHello_wrapper",text:"点击弹出对话框",handler:function(){F.disable('btnHello');__doPostBack('btnHello','');}});F.util.removePageLoading(false);F.util.triggerReady();});//]]>
</script>
测试结果:
见BUG截图
附件太大,传到百度网盘:http://pan.baidu.com/s/1pWmi
|