KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

DataGrid renderer: Use raw data for sorting, renderer should only impact view #285

Open Michael Wenleder opened this topic on on May 17, 2018 - 4 comments

Michael Wenleder commented on May 17, 2018

Hi team,

What I am missing is the possibility to tell the formatter to only format for type == display: The sorting should be based on the raw data.

"render": function (data, type, row, meta) {
    if (type === 'display') {

Another example at data tables

For example if I have numbers for days. And I want to use the formatter to color all numbers from 0 - 30 in green, all in 30 - 90 in yellow and all above in red. With the original DataTables I use the type === display comparison to ensure that sorting is still possible based on the integer value. If I use DataGrid I could not find an option to avoid a miss functional sorting.

Do you have any solution for this issue?

Thanks!

Michael Wenleder commented on May 21, 2018

Hi team,

here another example I know how to do in Datatables but not in DataGrid

"aoColumnDefs": [{
                    "aTargets": [4, 5, 6],
                    "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                        if (sData < "0") {
                            $(nTd).css('color', 'red')
                            $(nTd).css('font-weight', 'bold')
                        }
                    }
                }],

How would you do this using the formatValue property?

Thanks

KoolReport commented on May 23, 2018

We will need to make some testing and come back to you on this issue. Thank you very much for your patience.

Michael Wenleder commented on Jun 13, 2018

Hi Team,

is there any update on your side?

KoolReport commented on Jun 14, 2018

Yep, we are exploring couple of solutions but not yet finalize. It will be in next version of DataGrid

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

DataGrid