• <small id='0T8xM'></small><noframes id='0T8xM'>

      <bdo id='0T8xM'></bdo><ul id='0T8xM'></ul>
  • <tfoot id='0T8xM'></tfoot>
    <i id='0T8xM'><tr id='0T8xM'><dt id='0T8xM'><q id='0T8xM'><span id='0T8xM'><b id='0T8xM'><form id='0T8xM'><ins id='0T8xM'></ins><ul id='0T8xM'></ul><sub id='0T8xM'></sub></form><legend id='0T8xM'></legend><bdo id='0T8xM'><pre id='0T8xM'><center id='0T8xM'></center></pre></bdo></b><th id='0T8xM'></th></span></q></dt></tr></i><div id='0T8xM'><tfoot id='0T8xM'></tfoot><dl id='0T8xM'><fieldset id='0T8xM'></fieldset></dl></div>
  • <legend id='0T8xM'><style id='0T8xM'><dir id='0T8xM'><q id='0T8xM'></q></dir></style></legend>

        layui中修改页面layer.open弹出层给radio赋值

        时间:2023-10-30

          <tbody id='2QZoJ'></tbody>
      1. <legend id='2QZoJ'><style id='2QZoJ'><dir id='2QZoJ'><q id='2QZoJ'></q></dir></style></legend>
      2. <tfoot id='2QZoJ'></tfoot>
        • <small id='2QZoJ'></small><noframes id='2QZoJ'>

          <i id='2QZoJ'><tr id='2QZoJ'><dt id='2QZoJ'><q id='2QZoJ'><span id='2QZoJ'><b id='2QZoJ'><form id='2QZoJ'><ins id='2QZoJ'></ins><ul id='2QZoJ'></ul><sub id='2QZoJ'></sub></form><legend id='2QZoJ'></legend><bdo id='2QZoJ'><pre id='2QZoJ'><center id='2QZoJ'></center></pre></bdo></b><th id='2QZoJ'></th></span></q></dt></tr></i><div id='2QZoJ'><tfoot id='2QZoJ'></tfoot><dl id='2QZoJ'><fieldset id='2QZoJ'></fieldset></dl></div>

                  <bdo id='2QZoJ'></bdo><ul id='2QZoJ'></ul>
                  最近使用layui做了个简单的项目,遇到了个问题,在layui.table渲染页面做修改的时候,使用的是弹出层,要把值赋给radio的时候总是渲染不上去。现在解决了这个问题,记录一下。

                  js代码块代码:
                  function updateUser(data) {
                      layer.open({
                      type : 2,
                      title : '修改用户信息',
                      skin : 'layui-layer-rim', //加上边框
                      closeBtn :1,
                      area : [ '400px', '600px' ] //宽高
                                    ,
                      id : 'LAY_layuipro' //设定一个id,防止重复弹出
                                    ,
                      offset : '10px',
                      moveType : 0 //拖拽模式,0或者1
                                    ,
                      content : 'lz/user/user_upd.html',
                                    
                      success : function(layero, index2) {
                  
                      var body = layer.getChildFrame('body', index2);
                      //获取content的窗口
                      var iframeWin = layero.find('iframe')[0].contentWindow;
                      body.find("#id").val(data.id);
                      body.find("#username").val(data.username);
                      body.find("#real_name").val(data.real_name);
                      body.find("#department").val(data.department);
                      body.find("input[name=account_type][value=0]").attr("checked",data.account_type == 0 ? true : false);
                      body.find("input[name=account_type][value=1]").attr("checked",data.account_type == 1 ? true : false);
                      iframeWin.layui.form.render();
                      },
                      end : function() {
                      layer.close();
                      }
                      })
                  
                      }
                  iframe中的代码如下:
                  <form id="upd1" name="upd1" class="layui-form" lay-filter="formTest">
                          <div class="layui-form-item">
                            <label class="layui-form-label">登录名</label>
                            <div class="layui-input-inline shortInput">
                              <input type="text" id="username" name="username" value="wc" required lay-verify="required" autocomplete="off" class="layui-input">
                            </div>
                          </div>
                          <div class="layui-form-item">
                            <label class="layui-form-label">真实姓名</label>
                            <div class="layui-input-inline shortInput">
                              <input type="text" id="real_name" name="real_name" value="Jimmy" required lay-verify="required" autocomplete="off" class="layui-input">
                            </div>
                          </div>
                          <div class="layui-form-item">
                            <label class="layui-form-label">部门名</label>
                            <div class="layui-input-inline shortInput">
                              <input type="text" id="department" name="department"  autocomplete="off" class="layui-input">
                            </div>
                          </div>
                          <div class="layui-form-item">
                            <label class="layui-form-label">原始密码<span style="color: red;">*</span></label>
                            <div class="layui-input-inline shortInput">
                              <input type="password" id="old_pwd" name="old_pwd" autocomplete="off" class="layui-input">
                            </div>
                          </div>
                          <div class="layui-form-item">
                            <label class="layui-form-label">新密码<span style="color: red;">*</span></label>
                            <div class="layui-input-inline shortInput">
                              <input type="password" id="pwd" name="pwd" autocomplete="off" class="layui-input">
                            </div>
                          </div>
                          <div class="layui-form-item">
                            <label class="layui-form-label">确认密码<span style="color: red;">*</span></label>
                            <div class="layui-input-inline shortInput">
                              <input type="password" name="pwd" lay-verify="required|confirmPass" autocomplete="off" class="layui-input">
                            </div>
                          </div>
                          <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 100px;">是否为管理员</label>
                            <div class="layui-input-block"  id="account_type">
                              <input id="yes" type="radio" name="account_type" value="0" title="是">
                              <input id="no" type="radio"  name="account_type" value="1" title="否">
                            </div>
                          </div>
                          
                          <div class="layui-form-item">
                            <div class="layui-input-block">
                              <button class="layui-btn" lay-submit lay-filter="submitBut">立即提交</button>
                              <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                          </div>
                        </form>
                  上一篇:layui时间格式错误或者出现NaN-NaN-NaN问题怎么解决? 下一篇:没有了

                  相关文章

                  最新文章

                  <legend id='nXsiJ'><style id='nXsiJ'><dir id='nXsiJ'><q id='nXsiJ'></q></dir></style></legend>
                  <i id='nXsiJ'><tr id='nXsiJ'><dt id='nXsiJ'><q id='nXsiJ'><span id='nXsiJ'><b id='nXsiJ'><form id='nXsiJ'><ins id='nXsiJ'></ins><ul id='nXsiJ'></ul><sub id='nXsiJ'></sub></form><legend id='nXsiJ'></legend><bdo id='nXsiJ'><pre id='nXsiJ'><center id='nXsiJ'></center></pre></bdo></b><th id='nXsiJ'></th></span></q></dt></tr></i><div id='nXsiJ'><tfoot id='nXsiJ'></tfoot><dl id='nXsiJ'><fieldset id='nXsiJ'></fieldset></dl></div>

                  <small id='nXsiJ'></small><noframes id='nXsiJ'>

                      • <bdo id='nXsiJ'></bdo><ul id='nXsiJ'></ul>

                    1. <tfoot id='nXsiJ'></tfoot>