How set a dropdown ?
How set a dropdown ?
I want to set a dropdown in DataTables "columns" so if the received data is 1 it show A and if it is 2, B for example.
In dataTable.Editor if I set:
fields: [
{
"label": "Permiso:",
"name": "usu_codper",
"fieldInfo": "Permiso de acceso a la tabla",
"type": "select",
"options": [
{label: "Lectura", value: 1},
{label: "Escritura", value: 2}
]
},
],
it work.
But how do I do if I'm not in editor?.
Thanks.
Replies
I see how to do this:
"columns": [
{ "data": "usu_codper" ,
render: function (val, type, row) {
if (val == 1) {
$texto = 'Lectura';
} else {
$texto = 'Escritura';
}
return $texto ;
}
},
Just to check - are you happy that this is resolved now?
Allan
Yes Alan; please close it.
And congratulations for your great work.
Best regards,
jorge.