FineUI 官方论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

本论坛已关闭(禁止注册、发帖和回复)
请移步 三石和他的朋友们

FineUI首页 WebForms - MVC & Core - JavaScript 常见问题 - QQ群 - 十周年征文活动

FineUI(开源版) 下载源代码 - 下载空项目 - 获取ExtJS - 文档 在线示例 - 版本更新 - 捐赠作者 - 教程

升级到 ASP.NET Core 3.1,快、快、快! 全新ASP.NET Core,比WebForms还简单! 欢迎加入【三石和他的朋友们】(基础版下载)

搜索
查看: 3407|回复: 3
打印 上一主题 下一主题

RadioButton位置不对且可多选

[复制链接]
跳转到指定楼层
楼主
发表于 2017-9-6 16:01:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. @section body {
  2.     @(F.Form()
  3.         .ID("SimpleForm1")
  4.         .ShowBorder(true)
  5.         .BodyPadding(10)
  6.         .CssClass("f-shadow")
  7.         .LabelWidth(80)
  8.         .ShowHeader(true)
  9.         .Title("统计")
  10.         .Width(350)
  11.         .Items(
  12.             F.RadioButton()
  13.                 .ID("rbtnFirst")
  14.                 .Label("选项:")
  15.                 .Checked(true)
  16.                 .GroupName("MyRadioGroup1")
  17.                 .Text("全部"),
  18.              F.FormRow()
  19.                 .ID("FormRow1")
  20.                 .ColumnWidths("45% 30%")
  21.                 .Items(
  22.                      F.RadioButton()
  23.                        .ID("rbtnSecond")
  24.                        .GroupName("MyRadioGroup1")
  25.                        .ShowEmptyLabel(true)
  26.                        .Text("栋名"),
  27.                      F.TextBox()
  28.                        .ID("TextBox1")
  29.                        .ShowLabel(false)
  30.                ),
  31.                F.FormRow()
  32.                  .ID("FormRow2")
  33.                  .ColumnWidths("45% 30%")
  34.                  .Items(
  35.                      F.RadioButton()
  36.                        .ID("rbtnSecond")
  37.                        .GroupName("MyRadioGroup1")
  38.                        .Text("房号"),
  39.                      F.TextBox()
  40.                        .ID("TextBox2")
  41.                        .ShowLabel(false)
  42.                )
  43.         )
  44.     )
  45. }
复制代码
一组RadioButton有3个选择,但最后2个可同时选择且位置不符
浏览器:chrome

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
沙发
 楼主| 发表于 2017-9-6 16:14:29 | 只看该作者
位置不对原来少了一个.ShowEmptyLabel(true),但是可同时多选怎样解决?
板凳
发表于 2017-9-6 16:18:59 | 只看该作者
.GroupName("MyRadioGroup1") ,这个就是保证单选的,可以对比下示例:http://fineui.com/demo_mvc/#/demo_mvc/Form/RadioButton
地板
 楼主| 发表于 2017-9-6 17:27:14 | 只看该作者
示例看过了,跟示例不同的是RadioButton外面边多了个FormRow,不过自己还是解决了,就想知道这是不是BUG。
        public ActionResult OnCheckedChanged1(bool isChecked)
        {
            if (isChecked)
            {
                UIHelper.CheckBox("RadioButton2").Checked(false);
                UIHelper.CheckBox("RadioButton3").Checked(false);
            }
            return UIHelper.Result();
        }
        public ActionResult OnCheckedChanged2(bool isChecked)
        {
            if (isChecked)
            {
                UIHelper.CheckBox("RadioButton1").Checked(false);
                UIHelper.CheckBox("RadioButton3").Checked(false);
                UIHelper.CheckBox("TextBox1").Focus();
            }
            return UIHelper.Result();
        }
        public ActionResult OnCheckedChanged3(bool isChecked)
        {
            if (isChecked)
            {
                UIHelper.CheckBox("RadioButton2").Checked(false);
                UIHelper.CheckBox("RadioButton1").Checked(false);
                UIHelper.CheckBox("TextBox2").Focus();
            }
            return UIHelper.Result();
        }
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|FineUI 官方论坛 ( 皖ICP备2021006167号-1 )

GMT+8, 2024-4-20 07:48 , Processed in 0.048392 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表