EasyUI Forum
September 13, 2025, 08:38:05 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: negative values and generally symbols in pivotgrid  (Read 5566 times)
pkopsidas
Newbie
*
Posts: 1


View Profile Email
« on: July 14, 2016, 11:45:57 PM »

Hello i started using pivotgrid for a project but i don't seem to find how to pass negative values in the cells or symbols like ($, €). Can anyone help me cause it is a bit tricky to use but has features i want
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: July 16, 2016, 01:09:12 AM »

Please define a 'formatter' function for the value fields to custom the value format.
Code:
pivot:{
    rows:['Country','Category'],
    columns:['Color'],
    values:[
        {field:'Price',op:'sum'},
        {field:'Discount',op:'sum',
            formatter:function(value,row){
                return '$'+value;
            }
        }
    ]
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!