jqGrid formatter and sortable column - doesn't sort

Posted by HeavyWave on Stack Overflow See other posts from Stack Overflow or by HeavyWave
Published on 2010-05-03T06:46:56Z Indexed on 2010/05/03 6:48 UTC
Read the original article Hit count: 350

Filed under:
|

I am using a custom formatter for my jqGrid columnModel and I can't get sorting to work with formatter functions. If I remove formatter column sorts normally.

colModel: [
        { name: 'status', index: 'status', width: 18, sorttype: 'int', align: 'center', formatter: function(cellvalue, options, rowObject) {
            return cellvalue == 1 ? "<img src='images/agent_green_s.png' alt='Ready' title='Ready' />" :
            cellvalue == 3 ? "<img src='images/agent_red_s.png' alt='Busy' title='Busy' />" :
            "<img src='images/agent_orange_s.png' alt='Pending Ready' title='Pending Ready' />";
        }

How do I get sorting to work properly?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jqgrid