Search code examples
javascriptjqgrid

how to show readonly fields in edit form in jqgrid or other way to show whole text from readonly column


jqGrid colModel contains read-only multi line column defined using properties below. Content line lenghts are greater than column width, text is to long so that tooltio does not show its whole content. It is not possible to see whole content.

I'm looking for a way allow user to see whole column content. For example, if edit form button is pressed, this column content should de displayeid in edit form as readonly textarea. However, readonly columns does not appear in edit form.

How to allow user to see whole column content ?

colModel: [{
"name":"LoggedLongText",
"editable":false,"width":539,
"classes":"jqgrid-readonlycolumn","fixed":true,
"hidden":false,"searchoptions":{"sopt":["cn","eq","ne","lt","le","gt","ge","bw","ew","nc"]}}
}]

Solution

  • Is the setting

    editable: true, editoptions: { readonly: "readonly" }
    

    probably what you need?

    UPDATED: Free jqGrid supports more values for editable property starting with version 4.8. The wiki article described that editable can be function and it supports additionally three string values in case of using form editing: "hidden", "disabled" and "readonly".