【发布时间】:2011-02-01 20:04:36
【问题描述】:
有没有办法将 modalDialog 中的列定义为视图列(没有任何输入元素,既不可编辑也不可保存)?还是只能通过edittype:'custom' 工作?
我的设置在那里:
【问题讨论】:
标签: jqgrid
有没有办法将 modalDialog 中的列定义为视图列(没有任何输入元素,既不可编辑也不可保存)?还是只能通过edittype:'custom' 工作?
我的设置在那里:
【问题讨论】:
标签: jqgrid
jqGrid 使用$.jgrid.createEl 方法为任何类型的编辑构建元素,包括form editing(函数editGridRow)。您如何在the source code of the function createEl 中看到它使用<input>、<select>、<button>、<textarea> 或<span> 元素作为表单对话框的“输入”部分。选择取决于相应jqGrid列的edittype。
因此,您必须使用edittype:'custom' 才能拥有<span> 元素,或者您可以尝试在beforeShowForm 事件处理程序中修改表单元素。
【讨论】:
'custom_element' => "function(value, options) {return '<span>'+value+'</span>';}",函数完成了它是最好的方法吗?我在这里不喜欢的是 span-element 被渲染了两次。我尝试使用已经存在的跨度,但没有成功。
<span class="FormElement">...</span> 中。所以你自己不需要它。
<input> 元素中。所以如果你不想拥有<input> 元素,你可以使用edittype:'custom' 的任何实现。