如何在jqGrid表单中添加简单的文本标签? [英] How to add a simple text label in a jqGrid form?

查看:449
本文介绍了如何在jqGrid表单中添加简单的文本标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用分页器的添加或编辑表单时,我想知道如何在表单中添加一个简单的静态标签,而不用在colNames []和colModel []的影响中创建任何其他列。例如,我有一个非常简单的典型添加表单,它从包含几个标签和表单元素的传呼机打开:姓名,电子邮件,网站等,然后窗体的下半部分有几个下拉菜单,其中包含数字1到10,其目的是要求用户选择一个介于1到10之间的值,以重视他们对旁边列出的产品或服务的重视程度。在本节之上,我想添加一些文本来给出一个简短的指示,要求用户使用比例来选择以下产品和服务的重要性:[1 =低利息--- 10 =非常高的利息]。我无法弄清楚如何在表单中插入文本标签,而无需使用formoption {}等来定义列,而这仅仅是一些描述性文本所不需要的。我知道bottominfo:'一些文本''用于向表单底部添加文本,但我需要在表单中插入一些类似于中间(或其他位置)的文本,而不会影响表单结构格。这甚至有可能吗? TIA。

When using the Add or Edit form from the pager I'm wondering how a simple static label can be added in the form without it creating any additional columns in it's affect on colNames[]'s and colModel[]'s. For example I have a quite simple typical Add form which opens from the pager containing a few label's and form elements: Name, Email, Web Site, etc., and then the lower section of the form has a few drop down menus containing the number 1 through 10 with the idea being to ask the user to pick a value between 1 and 10 to put a value on the importance to them about the product or service which is listed beside it. Just above this section I want to add some text only to give a brief instruction asking the user to "Choose the importance of the following products and services using the scale: [1=Low interest --- 10=Very high interest]". I cannot figure out how to get a text label inserted in the form without having to define a column with a formoption{} etc which is not needed for just some descriptive text. I know about the "bottominfo: 'some text'" for adding text to the bottom of the form but I need to insert some text similar to that mid-way (or other positions) in the form without it affecting the tabular structure of the grid. Is this even possible? TIA.

推荐答案

您可以在 afterShowForm 。表单字段的ID就像tr_Name。由tr_前缀和相应的列名组成。

You can modify Edit or Add forms inside of afterShowForm. The ids of the form fields are like "tr_Name". There consist from "tr_" prefix and the corresponding column name.

我修改了我的旧答案,以便在添加dialod中存在一个带粗体文本附加信息:的附加行。在编辑对话框中(就像在原始问题中想要的那样),一列的输入字段被禁用。您可以在此处查看示例。我希望一个有效的代码示例可以说更多的话。

I modified the code example from my old answer so that in the Add dialod there exist an additional line with the bold text "Additional Information:". In the "Edit" dialog (like one want in the original question) the input field for one column is disabled. You can see the example live here. I hope that a working code example can say more as a lot of words.

这篇关于如何在jqGrid表单中添加简单的文本标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆