我想在grails中编辑一个可编辑的g:select。我有一个g:选择我的默认值,但我想可以从手中添加一些。我怎样才能做到这一点?editable dropdown(g:select)grails
回答
<g:select name="selectName" from="${yourValue}"
optionKey="field" optionValue="field" class="form-control" noSelection="['': '']" value="${defaultValue}"/>
option键=“场” - 如果你有对象的列表(图) optionValue =“场” - 如果你有对象的列表(发送到服务器)
从ü可以添加这样的事情:
from="${["1","2","3"]}"
这怎么回答题?我不认为给出的示例允许用户添加一个新的选项,该选项不是由'from'属性的值指定的。 – gogognome 2015-04-03 13:12:33
小学。他的问题是:如何将我自己的价值添加到g:select?答:
我的印象是问题是如何让ag:选择用户有可能添加新的值。所以你会得到一个输入字段,用户可以从组合框中选择一个选项并输入一个新的值。 – gogognome 2015-04-06 09:42:13
- 1. grails g:select i18n
- 2. 如何配置和检索g:select中的值在Grails中?
- 3. x-editable:删除“.editable-unsaved”类
- 4. C#wpf datagrid editable
- 5. Non-Editable NSButton-CheckBox
- 6. Make UITableViewCell editable
- 7. dropdown align dropdown-toggle right
- 8. X-Editable&PHP MySQL表
- 9. x-editable form with typehead
- 10. jquery-datatables-editable定制
- 11. x-editable,bootstrap和symfony
- 12. jquery editable编辑链接?
- 13. Editable Div插入位置
- 14. 使用x-editable切换select2
- 15. Sms intent with non editable message body
- 16. x-editable combodate动态日期
- 17. x-editable在bootstrap 4中?
- 18. Laravel x-editable CRSF问题
- 19. X-editable日期格式
- 20. Dropdown postback
- 21. Dropdown NullReferenceException
- 22. Multiselect dropdown
- 23. Bootstrap X-editable当data-editable-type =“number”时,表格弹出不正确定位
- 24. Bootstrap Dropdown selected item
- 25. WPF ComboBox DropDown Placement
- 26. Bootstrap 3 dropdown navbar
- 27. MVC3 DropDown List
- 28. Scrollable Dropdown Multiselect
- 29. Terik Grid Dropdown Column
- 30. finalescript select from dropdown
看看http://stackoverflow.com/questions/740195/adding-options-to-a-select-using-jquery-javascript – saw303 2014-10-16 11:07:14