Using render in datatable makes it readonly but want edit
Using render in datatable makes it readonly but want edit
Hi, I am using datatable and Editor plugin along with. I have written render for a column and it is showing the value with % but readonly mode. Is render meant to make the field readonly. The need to have a editable input field formatted to show %. Can you please give other options to make this possible. Thanks.
{
"title": "Marks by percent",
"data": null,
"orderable": false,
"render": function(){
return marks + '%';
}
},
This question has an accepted answers - jump to answer
Answers
I'm not sure what you're trying to do here. You've set
data: null
, meaning there's no data for this column, but then in thecolumns.render
you havereturn marks + '%';
- where doesmarks
come from?I've changed the
age
column here to be a percentage. Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.Cheers,
Colin