Problem with mRender and search

Problem with mRender and search

svssergiosvssergio Posts: 1Questions: 1Answers: 0

Hi!

I'm having problems with the function mRender.

I have a database that is processed through server, and i want to change some of the data returned.
Example, in my table, instead of having the name of the state in every user, i have an id of the state that is taken from another table, but when I receive it to datatable, I want to change it to the name of the state. It works fine, but when i use the search input, it only recognize the id of the state and not the name of the state.

Here's my code:

'bProcessing': true,
"bServerSide": true,
"sAjaxSource": "../include/pro_datatables.php",
"sAjaxDataProp" : "aaData",
"bPaginate": true,
"sServerMethod": "POST",
"aoColumns": [
    { "aaData": "state",
          //Here, i change the id to the name of the state, the array namestate was previously populated
      "mRender": function (data) {
               return namestate[data];
      }
    },
    { "aaData": "municipio" },
    { "aaData": "ciudad" }
],
//my code continious...

Thank you so much for your help.

This discussion has been closed.