1
在最新的免费jqgrid textarea用于内联和表单编辑。 内联编辑列宽应为350px。这是在colmodel中指定的,并且正常工作。如何在表单中增加textarea宽度在免费jqgrid中编辑
如何在表单中增加textarea宽度编辑多于350px,以便它占据表单编辑窗口中的整个编辑列或具有更大的硬编码宽度? 我试图使用模板中的类属性来添加类只在表单编辑,但类不添加到textarea。
Colmodel:
{"template":MultiLineTemplate,
"name":"Avaldis",
"editoptions":{
"class":"",
"readonly":null
},
"editrules":{"edithidden":true},
"editable":function(options){return getEditable(options,false);}
,"width":350
}
的JavaScript中使用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";
}
风格:
.jqgrid-multiline-cell {
max-height: 2.8em;
overflow-x: hidden;
}
问题how to restrict jqgrid textarea height in grid only有点与此相关的。
谢谢。有效。 – Andrus
@安德鲁斯:不客气! – Oleg