JQuery Datatable column definition to be of type "textarea" and also "readonly"

JQuery Datatable column definition to be of type "textarea" and also "readonly"

ersanirersanir Posts: 8Questions: 3Answers: 0

My jquery datatable editor column is defined like this:

{title: "en_us", data: "en_us", type: "textarea", width: '20%'}

I want the column to be both readonly and of type textarea. How can I achieve this ?

Answers

  • rf1234rf1234 Posts: 2,947Questions: 87Answers: 416

    That looks like a data table column definition and not like an editor field definition. But anyway ...

    {title: "en_us", data: "en_us", type: "textarea", width: '20%'}
    

    So you can either do this which is the best option
    https://datatables.net/forums/discussion/44364

    or you define a second field type using jQuery:

    editor
        .on('open', function(e, mode, action) { 
            $('#DTE_Field_en_us').attr('readonly', true); 
        })
    
This discussion has been closed.