首页 > 其他分享 >ExtJs GridPanel 自定义汇总

ExtJs GridPanel 自定义汇总

时间:2023-05-19 12:11:35浏览次数:36  
标签:function GridPanel return 自定义 Format number value amount ExtJs

{
  text: '订单金额',
  dataIndex: 'amount',
  renderer: function(value){
    return Ext.util.Format.number(value, '0.00'); 
  },
  summaryType: function(records) {
    var amount = 0;
    var length = records.length;
    for(var i = 0; i < length; i++) {
      var record = records[i];
      if(record.get('payType') == 'alipay') {     // 汇总条件 
        amount += record.get('amount');      // 汇总方式
      }
    }
    return Ext.util.Format.number(amount, '0.00');
  }
}

  


column_ofYouWant.summaryType=function(records){return 888;};

{
  text: '订单金额',
  dataIndex: 'amount',
  renderer: function(value){
    return Ext.util.Format.number(value, '0.00'); 
  },
  summaryType: 'sum',
  summaryRenderer: function(value){
    return '<span style="color:red">' + Ext.util.Format.number(value, '0.00') + '</span>';
  }
}

 

column_ofYouWant.summaryType=function(value){     return '<span style="color:red">' + Ext.util.Format.number(value, '0.00') + '</span>';   };

标签:function,GridPanel,return,自定义,Format,number,value,amount,ExtJs
From: https://www.cnblogs.com/wkk2020/p/17414769.html

相关文章

  • Vue 自定义指令实践
    Vue自定义指令一个自定义指令由一个包含类似组件生命周期钩子的对象来定义。钩子函数会接收到指令所绑定元素作为其参数。在 <scriptsetup> 中,任何以 v 开头的驼峰式命名的变量都可以被用作一个自定义指令。eg: 在上面的例子中,vFocus 即可以在模板中以 v-focus 的形......
  • \033[0m 有什么用——python 输出颜色自定义
    "\033"是什么?\033或\33相当于python中的关键字,可以改变输出字体的属性,具体参考ECMA-48标准《ControlFunctionsforCodedCharacterSets》参数有什么?字颜色:30-----------3730:黑31:红32:绿33:黄34:蓝色35:紫色36:深绿37:白色字背景颜色范围:40----47......
  • 折线图 最大值显示白点,默认显示tooltip框框,自定义tooltip
    效果图: 代码如下:(直接放整个vue文件了,省事)<template><div><divstyle="width:406px;height:220px"id="zz_r_two1"></div><divclass="xsTitle"><divclass="fang"></div>......
  • HTML属性 分为两种Property 固有属性Attribute 自定义属性
    HTML属性 分为两种Property固有属性Attribute自定义属性。固有属性就是浏览器给默认给html标签绑定上的属性。 操作固有属性固有属性可以通过对象.属性名这样方式来设置和获取值。什么是自定义属性自定义属性就是用户自己定义,在固有属性列表中没有的属性。获取自定义......
  • elementplus tag数组。并且表格不换行,宽度自定义
    修改bugbug那些tag要是没有内容的话全部加上<el-tagv-if="scope.row.label">{{scope.row.label}}</el-tag>以及兴趣栏目其实是tag数组。并且表格不换行,宽度自定义<el-tablestyle="width:100%"border><el-table-column:label="......
  • 自定义全局监听事件( $on $emit $off )
    app.jsApp({handlerGather:{},onLaunch:function(){const_that=thiswx.$on=function(event,fn){if(Array.isArray(event)){event.forEach(item=>{wx.$on(item,fn)})}else{(_that.......
  • 【React】自定义水印方法
    创建水印方法:constsetWaterwark=({//使用ES6的函数默认值方式设置参数的默认取值container=document.body,width='250px',height='160px',textAlign='left',textBaseline='bottom',font='15pxM......
  • vue自定义组件——search-box
    github地址:https://github.com/lxmghct/my-vue-components组件介绍props:value/v-model:检索框的值,default:''boxStyle:检索框的样式,default:'position:fixed;top:0px;right:100px;'highlightColor:高亮颜色,default:'rgb(246,186,130)'......
  • 【Echarts】tooltip自定义提示框
    1组件可直接使用。2tooltip:{3show:true,4trigger:'axis',5confine:true,6padding:0,7borderWidth:0,8backgroundColor:'rgba(1,1,1,0)',9//axisPointer:{10......
  • Linux- 环境变量和自定义配置
    环境变量查看查看当前用户的全部环境变量:env,可以结合env|grep筛选信息查看当前系统的全部环境变量:export查看指定环境变量:printenv$env_name或者echo$env_name清除指定环境变量的值:unset$env_name常用环境变量PATH可执行程序的搜索目录,可执行程序包括Linux......