在jqgrid添加/编辑表单中显示列的两个编辑字段

时间:2011-12-06 07:03:22

标签: jqgrid

我有一个客户请求在jqgrid添加/编辑表单中有一个下拉列表和一个移动号码列的文本字段。

喜欢这个

Mobile number <countrycode drop down> <mobile number text field>

我想知道这可以在jqgrid添加/编辑表单中完成吗?如果是,那怎么办?

@UPDATE: 以下是我想要添加/编辑表单中的输出(您需要使用以下代码创建一个html文件并在浏览器中查看输出)。抱歉无法上传图片,没有那么多的声誉:( ...

<html>
<body>
<table>
  <tr>
<td>Phone#</td>
<td>:</td>
<td> 
        <select><option value=1>1</option></select>  
        <input type="text"/>
    </td>
  </tr>
</table>
</body>
</html>

2 个答案:

答案 0 :(得分:0)

使用jqgrid肯定是可行的。我想你会发现this question与你想要完成的事情有关。特别感兴趣的是colModel中的edittype为您有兴趣进行选择的字段设置的方式。文本输入将是编辑模式中字段的默认格式。

所有这一切,我假设你没有使用jqGrid的付费版本,如果你是这样,你需要设置你的编辑选项有点不同。您可以在付费版here中了解更多信息。

答案 1 :(得分:0)

虽然已经5年了,但没有人回答,我有同样的问题,而且我一直在寻找解决方案。这很容易,但我有很多时间去做。就像这样:

在ColModel中设置formoptions:{rowpos:x,colpos:y}:

colModel: [
            { name: "CategId", index: "CategId", label: arrTool.CategId, width: 100, editable: true, formoptions: { rowpos: 1, colpos: 1 } },
            { name: "Category", index: "Category", label: arrTool.Category, width: 100, editable: true, formoptions: { rowpos: 1, colpos: 2 } }
]

结果: enter image description here

相关问题