In latest free jqgrid textarea is used for inline and form editing. In inline editing column width should be 350px. This is specified in colmodel and works OK.
How to increase textarea width in form editing more that 350px so that it occupies whole edit column in form edit window or has some bigger hard-coded width? I tried to use class property in template to add class in form editing only but class is not added to textarea.
Colmodel:
{"template":MultiLineTemplate,
"name":"Avaldis",
"editoptions":{
"class":"",
"readonly":null
},
"editrules":{"edithidden":true},
"editable":function(options){return getEditable(options,false);}
,"width":350
}
javascript used in colmodel:
var multilinePrefix = '<div class="jqgrid-multiline-cell">';
var MultiLineTemplate = {
edittype: "textarea",
searchoptions: { sopt: ["cn", "nc"] },
formatter: function (v) {
return multilinePrefix + (v == null ? '' : $.jgrid.htmlEncode(v)) + '</div>';
},
unformat: function (cellvalue) {
return cellvalue;
},
editoptions:
{
rows: 3,
wrap: "off",
style: 'overflow-x: hidden',
}
};
function getEditable(options, isReadonly) {
if (!isReadonly) {
return true;
}
if (options.mode === "cell" || options.mode === "add" || options.mode === "edit") {
return true;
}
return "readonly";
}
style:
.jqgrid-multiline-cell {
max-height: 2.8em;
overflow-x: hidden;
}
Question how to restrict jqgrid textarea height in grid only is somewhat related to this.