How to format/mask/filter data

How to format/mask/filter data

cloonerclooner Posts: 7Questions: 0Answers: 0
edited November 2010 in General
Let's say I have the columns id, title and datetime. The columns id and datetime are both integer and title is a string. now I want to alter the values that are being displayed so that the title becomes a link e.g.
[code]
%title%
[/code]
and that datetime is transformed from a integer value to a format like Month dd, Year. Of course all the colums have to be sortable on the original values. Is this even possible and so how do I apply these masks/formats?

Replies

  • cloonerclooner Posts: 7Questions: 0Answers: 0
    Found the solution by reading the documents... This should be in the examples... :P
    [code]
    "aoColumns": [
    { "bVisible": false },
    {
    "fnRender": function ( oObj ) {
    return '' + oObj.aData[1] + '';
    }
    },
    null,
    {
    "fnRender": function ( oObj ) {
    d = new Date(oObj.aData[3]*1000);
    var jm=["January","February","March","April","May","June","July","August","September","October","November","December"]
    return d.getDate() + ' ' + jm[d.getMonth()] + ', '+ d.getFullYear();
    }
    },
    null
    ]
    [/code]
This discussion has been closed.