-1

I have a Sencha GXT grid with columns to display file name, file extension and file size. When the data from DB is pushed to the grid, all info is right except for the size . For example, the file with 3Kb will be displayed in the grid as 3000 . Now , I would like to format 3000 as 3Kb. How can I achieve this with renderer? Can cell renderer do that? Thank you for your time.

P.S : The language I use is Java.

Huy Than
  • 1,538
  • 2
  • 16
  • 31

1 Answers1

1

in your column definitions of your grid you can specify a renderer callback:

columns:[...,{
    header: "blubb",
    dataIndex: "fileSize",
    renderer: function(value, meta){
        return Math.round(value/1000) + "Kb";
    }
},...]

hope this helps you.

Michel
  • 178
  • 7
  • Thank you for your answer. However, I am using Java, not Java Script. Could please show me the way in Java? – Huy Than Aug 29 '13 at 04:37