Using render in datatable makes it readonly but want edit

Using render in datatable makes it readonly but want edit

lazardlazard Posts: 1Questions: 1Answers: 0

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

  • colincolin Posts: 8,647Questions: 0Answers: 1,446
    Answer ✓

    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 the columns.render you have return marks + '%'; - where does marks 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

Sign In or Register to comment.