简体   繁体   English

在jTable中进行编辑或创建时,如何具有选择下拉菜单?

[英]how to have a select dropdown menu when editing or creating in jTable?

if you visit jtable.org and try to edit one of their records on the demo table you will notice a variety of field types. 如果您访问jtable.org并尝试在演示表上编辑他们的记录之一,您会注意到各种字段类型。 Theres checkbox, theres dropdown menu. 有复选框,有下拉菜单。 However in all the demos and downloaded examples the edit/create option only has textfields which is fine for a name but I need to know how to make it show a dropdown of options. 但是,在所有演示和下载的示例中,edit / create选项仅具有适合名称的文本字段,但是我需要知道如何使其显示选项下拉列表。 How do I do that? 我怎么做?

在字段中,只需添加选项。

options: {'0': 'Enabled', '1': 'Disabled'}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM