search by field value and duplicate field names in a table

search by field value and duplicate field names in a table

mavbcnmavbcn Posts: 4Questions: 2Answers: 0

Hi,

I have a question regarding field value to be used for search, and field value to be used for display.
I need to have a table with a field rendered with its value in a string, but I also need to do some filter / searches with its value.

I solved this using the same field but with display false , thats the field I use for search, and another one with the render to convert the displayed value. It is this correct?

 { data: "type_id" , display:false },
 { data: "type_id" , title: "Status" ,
                render: function ( data, type, row, meta ) {
                    if (data==1) return 'Active';
                    if (data==2) return 'Processed';
                    return 'other value ';
               }                
 },

thanks!

Answers

  • rf1234rf1234 Posts: 2,808Questions: 85Answers: 406

    What works is correct, I guess :smile:

    Thanks for sharing!

This discussion has been closed.