问题标签 [choicefield]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
button - 没有下拉表的 Wicket 自定义过滤器
我想为我的 DataTable 创建一个自定义过滤器。我想创建一个按钮,单击它时会更改表格的数据。我知道 wicket 必须提供的 ChoiceFilteredPropertyColumn,但根据我对它的理解,这是一个下拉过滤器。
我正在尝试实现类似下图的效果(Pancakes 是可点击的按钮):
有人能指出我正确的方向吗?
php - 如何知道控制器内部的选择字段有多少项 - Symfony2
我想在创建表单后计算选择的项目。该字段是一个简单的 Symfony 选择字段,带有用于创建项目的 query_builder。我怎样才能做到这一点?
提前致谢。
django - 将数据绑定到 django 的表单选择字段
我有一个简单的表格,
选择生成为
基本上,用户订阅了某些列表(来自列表的超集),并且可以(通过下拉菜单)选择他/她想要向哪个列表发送消息。
问题是我找不到如何将“CHOICES”绑定到 django 表单。
一些在线解决方案包括使用模型......但我没有查询集......只是我希望选择字段呈现的动态生成的 id 元组。
有任何想法吗 ?
谢谢 !
django - Django Choicefield 与 required=True 并且空白选择没有例外
我想我的问题从标题就很清楚了。
基本上我有一个带有动态选择字段的表单。我为选择字段创建了一个空白选项。
问题是如果我提交空白选项,表单会验证。我已经安装了 django 1.5,所以即使在早期版本中这样的东西有效,并且抛出了验证异常,现在它不是。
所以最大的问题是,我应该如何以及在哪里验证这样的事情?
我试图 ovveride Choicefield 和它的验证方法,但我仍然得到相同的结果:
安迪的想法伙计们?
django - 如何在django中为choicefield设置一个值
我有一个地址表格,其中包含国家的选择字段。我想在表单加载之前设置一个值。我怎么能那样做?这是表格:
django - Collapsible ChoiceField in Django
I have a django form with what is currently a TextField input that I'd like to turn into a ChoiceField so that I can do away with having to compare similar answers to determine if they refer to the same thing. However, the number of possible choice is prohibitive (several hundred). What I really would like is a collapsible ChoiceField where users could select a category, then a sub-category, and so on so that at each step they would only be presented with a reasonable number of options (especially since many users are on mobile devices with limited screen sizes). The options are quite amenable to unambiguous categorization and so this seems like a good way to display the information. However, while I see information about collapsing all sorts of other sorts of aspects of forms I haven't seen how to do this. I'm not even sure what avenue to pursue to make this work best. CSS or javascript seem to be the ways most people make collapsible lists but I don't know whether either of these will play well with a django Select widget. What's my best option to do this sort of thing?
Here are the options I'm aware of: 1) Write some sort of new widget. This sounds horrible (based on my experience writing new widgets) but if it's the best option I'll do it. 2) Use a normal select widget and use javascript to hide options. I'm not exactly sure how to select options in clean groups though. 3) Use a CSS collapsible list and and hidden form field with a bit of javascript to grab the value from the list and insert it into the hidden field. 4) Use a chain of views to navigate through to the smallest category. This sounds easy to do, nice and clean (because all the logic is in Python where I feel comfortable), but requires multiple reloads which may be problematic for mobile users.
django - Django CheckBoxSelectMultiple:单个复选框初始值
对于给定的字段,是否可以最初选中所有框,但只有一个?
目前我正在使用:widget=forms.CheckboxSelectMultiple({'checked':'checked'})
最初检查所有复选框。有没有办法为每个复选框单独设置这个?
python - Django:带有 if then 语句的选择字段
我需要 OrderAmount 下的选择字段来根据 StoreLiquor 中的 PackSize 显示不同的选择。我想我大概知道代码应该是什么样子,但我担心我的查询可能是错误的,而且我也不确定你把代码放在哪里。这是代码:
该模型:
视图(一旦我让代码工作,这将对它进行一些调整):
我的表格:
如果您需要任何其他信息,请告诉我(当我复制和粘贴时,某些缩进可能已被丢弃。)
c# - c#编辑word文件(设置选择字段)
我正在使用下面的函数通过书签在 doc.file 中正确填写数据,并且效果很好。
我在 word 文件中设置选择字段的值时遇到问题。我的问题是,甚至可以从我的 c# 应用程序中设置这种数据吗?有什么方法可以生成 Selected 或 unselected 字段,例如下面链接中的第 21 点,或者只设置它的值? http://www.fotosik.pl/pokaz_obrazek/c2409113d79afeba.html
最后一个问题是从 doc 文件生成整个报告是否可行且合理?
我正在寻找一些有助于通过 c# 完全生成我的声明的解决方案。
django - django modelchoicefield 选择列
当只选择 2 或 3 列时,我无法弄清楚如何格式化 ModelChoiceField 的输出。
这是我的模型:
下面的代码有效,但我得到了所有的列(所以对我的目的来说效率不高):
但是下面的代码不起作用:
如何解决问题?似乎当我选择列时,我的模型的 unicode 函数不再被调用。正确的?