关于 easy ui ShowFooter 属性设置 最近网站里面有用到easy ui 插件现在想做统计表格,datagrid 中 设置 showFooter 属性但是不论给这个属性赋什么值,页面都不会有变化有用过的大神指点一下谢谢了!datagridUI 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 绑定是调用webmethod 返回动态的数据类型 return new { rows = rsOrder, total = rsCount, pages = pageCount, footer = new { total=totalAmount,totalVolume=totalVolume} };看的资料说 返回 json类型的数据里面 有一个 footer 属性不知道还要怎么调望指点 1.请放弃easyui这个垃圾桶,就算你能显示footer,他也不是你认为的地方显示,他会紧跟在数据下显示(实际上easyui把footer就是当作最后一行数据显示滴)2.showfooter这个表明是否附加footer到最后一行,只有true,false两个值可以赋3.如果showfooter为true,并且你的json里有footer设置才可以显示{total:0,rows:[],footer:[]} 类似如此写法红字地方大概这样拼写把,已经放弃这垃圾n年,记忆里是这么拼写滴,建议里去官方把他那个demo的那个json后缀的文本文档打开看看,一看就明白了 footer = new { total=totalAmount,totalVolume=totalVolume}这一句错了,他要的是集合list<T>,而非一个T 我看他插件里面的排序 和分页还不错的现在就是绑定的时候要做一个统计效果 显示在最下方也可以我那个数据绑定式调用webMethod 返回类型是dynamic return new { rows = rsOrder, total = rsCount, pages = pageCount, footer = new { total=totalAmount,totalVolume=totalVolume} };前台绑定式这样的 function GetInquirList(curIndex, iPageSize) { $("#tableInquiry").datagrid("loading"); ErpHelper.Helper.OrderService.GetOrder(curIndex, iPageSize, oParas, function (result) { if (result.total > 0) { $('#tableInquiry').datagrid('loadData', result); } else { $('#tableInquiry').datagrid('loadData', { total: 0, rows: [] }); } }, function (error) { alert(error.get_message()); }); } function LoadDg() { $('#tableInquiry').datagrid({ showFooter: true.....就是想把footer 中的内容 作为这个表格的统计信息不知道 loadDg里面还要怎样设置? 按照你刚才说的改了 decimal totalCtn=orders.Sum(x=>x.CTN); decimal totalVolume=orders.Sum(x=>x.TotalVolume); decimal totalWeight=orders.Sum(x=>x.TotalWeight); decimal totalAmount=orders.Sum(x=>x.GoodsCost); List<decimal> footer = new List<decimal>(); footer.Add(totalCtn); footer.Add(totalVolume); footer.Add(totalWeight); footer.Add(totalAmount); return new { rows = rsOrder, total = rsCount, pages = pageCount, footer = footer };页面上报脚本错误,不知道页面上还需要什么设置,还是这里写的有什么问题 ? 那个T要和你的row一致,也就是你列名是什么,这个footer就是什么,之所以是list<T>,是easyui认为你可以绑多个footer所以这里其实是 List<object> footer = new List<object>(); footer.Add(new{列名1=数据1,列名2=数据2}); List<Object> footer = new List<Object>(); footer.Add(new { CTN = totalCtn, TotalVolume = totalVolume, TotalWeight = totalWeight, Amount = totalAmount }); 现在这样写应该没有问题了吧?但是前台绑定的时候还是没有显示这些统计信息而且有个列绑定的时候还报 undefined 脚本错误 貌似就是 必须要给每列都统计还有想在前面加个 total 并且给这行信息的字体 加粗 要怎样设置? asp.net 中把多个word合在一起 c#的序列化 SqlCommand需要using关闭吗? 关于非空验证控件的问题 在asp.net中的浮动窗口怎么做? url问题 新手请教,我使用的ACCESS数据库,用DETAILVIEW不能INSERT成功? 菜鸟问题,怎样取dropdownlist选中项的text? 求一SQL语句 用c#、asp.net来开发一个人事管理系统的一个问题 架设asp.net服务器问题 gridview页面间传值
return new
{
rows = rsOrder,
total = rsCount,
pages = pageCount,
footer = new { total=totalAmount,totalVolume=totalVolume}
};看的资料说 返回 json类型的数据里面 有一个 footer 属性
不知道还要怎么调
望指点
2.showfooter这个表明是否附加footer到最后一行,只有true,false两个值可以赋
3.如果showfooter为true,并且你的json里有footer设置才可以显示
{total:0,rows:[],footer:[]} 类似如此写法红字地方大概这样拼写把,已经放弃这垃圾n年,记忆里是这么拼写滴,建议里去官方把他那个demo的那个json后缀的文本文档打开看看,一看就明白了
return new
{
rows = rsOrder,
total = rsCount,
pages = pageCount,
footer = new { total=totalAmount,totalVolume=totalVolume}
};
前台绑定式这样的
function GetInquirList(curIndex, iPageSize) {
$("#tableInquiry").datagrid("loading");
ErpHelper.Helper.OrderService.GetOrder(curIndex, iPageSize, oParas, function (result) {
if (result.total > 0) {
$('#tableInquiry').datagrid('loadData', result);
}
else {
$('#tableInquiry').datagrid('loadData', { total: 0, rows: [] });
}
}, function (error) {
alert(error.get_message());
});
} function LoadDg() {
$('#tableInquiry').datagrid({
showFooter: true
.....
就是想把footer 中的内容 作为这个表格的统计信息不知道 loadDg里面还要怎样设置?
decimal totalCtn=orders.Sum(x=>x.CTN);
decimal totalVolume=orders.Sum(x=>x.TotalVolume);
decimal totalWeight=orders.Sum(x=>x.TotalWeight);
decimal totalAmount=orders.Sum(x=>x.GoodsCost);
List<decimal> footer = new List<decimal>();
footer.Add(totalCtn);
footer.Add(totalVolume);
footer.Add(totalWeight);
footer.Add(totalAmount);
return new
{
rows = rsOrder,
total = rsCount,
pages = pageCount,
footer = footer
};
页面上报脚本错误,不知道页面上还需要什么设置,还是这里写的有什么问题 ?
footer.Add(new{列名1=数据1,列名2=数据2});
footer.Add(new { CTN = totalCtn, TotalVolume = totalVolume, TotalWeight = totalWeight, Amount = totalAmount });
现在这样写应该没有问题了吧?
但是前台绑定的时候还是没有显示这些统计信息
而且有个列绑定的时候还报 undefined 脚本错误
还有想在前面加个 total 并且给这行信息的字体 加粗 要怎样设置?