Sencha Touch:如何确定输入是 FieldSet 中的最后一个输入
因此,如果您向 FieldSet 添加一堆输入,最后一个输入的底部会有圆角。在我的表单中,我根据表单顶部的复选框隐藏和显示表单内的输入。
因此,现在,一个输入虽然在逻辑上不是 Fieldset 中的最后一个,但在视觉上可能是暂时的最后一个。
有谁知道 Sencha 如何确定 Fieldset 中的最后一个输入?只需查看输入数组中的最后一个,或者我可以为输入设置一个属性来告诉它它现在是最后一个......?
So, if you add a bunch of inputs to a FieldSet, the last one has round corners on the bottom. In my form, tho, I hide and show inputs inside the form, depending on a Checkbox at the top of the form.
So now, it is possible that an input, tho logically not the last one in the Fieldset, to be visually, and temporarily, the last one.
Does anybody know how Sencha determines which is the last input in the Fieldset? Just looks which one is the last in the array of inputs, or there is a property I can set to an input to tell it that it is the last one now ... ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一个 CSS 规则 .x-form-fieldset .x-field:last-child,它将字段集的最后一个子级设置为具有圆底角。处理边缘情况的规则还有更多内容,但是添加(或隐藏/显示)到该字段集的任何字段都将仅根据其 HTML 位置应用适当的样式。
相应的规则位于 1.1.0 版的 \resources\themes\stylesheets\sencha-touch\default\widgets\_form.scss:294 中。
There is a CSS rule, .x-form-fieldset .x-field:last-child, which styles the last child of a fieldset to have rounded bottom corners. There is a bit more to the rule to handle edge cases, but any fields that are added (or hidden/shown) to that fieldset will have the appropriate styling applied just based on their HTML position alone.
The appropriate rule is in \resources\themes\stylesheets\sencha-touch\default\widgets\_form.scss:294 in release 1.1.0.
感谢mistagrooves帖子从上面,我已经成功了解决问题。我的想法是,我以编程方式将一个类“last”设置为输入,我希望它不会呈现为最后一个,然后在我的 CSS 中,我重写该 .last 类的规则,如下所示:
希望它有帮助
Thanks to mistagrooves post from above, I've managed to fix the problem. The idea is that I programmaticlly set a class "last" to the input I want it t be rendered as last, and then in my CSS, I rewrite the rules for that .last class like so:
Hope it helps