• <legend id='0BfkG'><style id='0BfkG'><dir id='0BfkG'><q id='0BfkG'></q></dir></style></legend>

    <tfoot id='0BfkG'></tfoot>
      <bdo id='0BfkG'></bdo><ul id='0BfkG'></ul>

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

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

      1. Layui中实现开关按钮的效果

        按钮代码如下: {field: 'state', title: '状态', width: 85, templet: function (data) { if (data.state == 0) { return 'div input type="checkbox" checked="" name="codeSwitch" lay-skin="switch" id="open" lay-filter="switchTest" switchId=' + data
      2. <legend id='nRC0S'><style id='nRC0S'><dir id='nRC0S'><q id='nRC0S'></q></dir></style></legend>

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

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

                • <bdo id='nRC0S'></bdo><ul id='nRC0S'></ul>
                    <tbody id='nRC0S'></tbody>
                  按钮代码如下:
                  {field: 'state', title: '状态', width: 85, templet: function (data) {
                                      if (data.state == 0) {
                                          return '<div> <input type="checkbox" checked="" name="codeSwitch" lay-skin="switch" id="open" lay-filter="switchTest" switchId=' + data.userId + '' +
                                              ' lay-text="启用|已禁用"  value=' + data.state + '></div>';
                                      }
                                      return '<div> <input type="checkbox" lay-skin="switch" name="codeSwitch"  switchId=' + data.userId + ' lay-filter="switchTest"' +
                                          'lay-text="启用|已禁用" value=' + data.state + '></div>';
                  
                                  }
                              }

                  实现操作js代码如下:

                  /**
                       * 监听开关 状态 操作
                       */
                      form.on('switch(switchTest)', function (data) {
                          /**
                           * 禁用标签
                           * 状态 赋值为 1
                           */
                          var layerIndex = layer.load(3);
                  
                          if ((this.checked ? 'true' : 'false') == 'false') {
                              $.ajax({
                                  url: '/users/delete',
                                  data: {
                                      state: 1,
                                      userId: data.elem.getAttribute("switchId")
                                  },
                                  type: 'PUT', //HTTP请求类型
                                  success: function (data) {
                                      console.log(data);
                  
                                      $.message({
                                          message: "禁用用户",
                                          type: 'success',
                                          showClose: true
                                      });
                  
                                  }, error: function () {
                                      $.message({
                                          message: "boom..",
                                          type: 'error',
                                          showClose: true
                                      });
                                  }
                  
                              })
                          } else {
                              /**
                               * 启动标签
                               * 状态 赋值为 0
                               */
                              $.ajax({
                                  url: '/users/delete',
                                  data: {
                                      state: 0,
                                      userId: data.elem.getAttribute("switchId")
                                  },
                                  type: 'PUT',
                                  success: function (data) {
                                      console.log(data);
                                      $.message({
                                          message: "启动用户",
                                          type: 'success',
                                          showClose: true
                                      });
                  
                                  }, error: function () {
                                      $.message({
                                          message: "boom..",
                                          type: 'error',
                                          showClose: true
                                      });
                                  }
                  
                              })
                          }
                          layer.close(layerIndex);
                  
                      });
                   
                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  核心方法 var index = layer.open({ type : 2, title : title, maxmin : true, offset: '100px', area : [ '600px', '500px' ], content : prefix + url// iframe的url }); layer.full(index); //最小化 type - 基本层类 类型:Number,默认:0 layer提供了5
                  1.图标为icon字体,html代码如下: nav class="mui-bar mui-bar-tab"a id="defaultTab" class="mui-tab-item mui-active" href="suoYouWenTi.html"span class="mui-icon mui-icon-help"span class="mui-badge"9/span/spanspan class="mui-tab-label"所有提问
                  解决mui的a标签无效: mui('body').on('tap','a',function(){ window.top.location.href=this.href;}); 解决mui无法点击元素的问题:(主要是mui屏蔽了click,更换成tap即可) $('#id').on('tap','xx',function(){ //dosomething});
                  xm-select是基于layui的多选解决方案,前身formSelects, 由于渲染速度慢, 代码冗余, 被放弃了xm-select使用了新的开发方式, 利用preact进行渲染, 大幅度提高渲染速度, 并且可以灵活拓展。 xm-select: 基于Layui, 下拉选择框的多选解决方案 通过一个简单的小例
                  我的传值 listDetail = li class=mui-table-view-cell mui-mediaa href=aJaxDetail.html?+arrayobj[i].id+div class=mui-media-body+arrayobj[i].digest+/div/a/li; 在cell 的a链接中拼接上需要传送的数据+arrayobj[i].id+ 获取数据 mui.init(); mui.plusRead
                  方法一:jQuery直接取值 var dep = layui.$("#dep").val(); //获取选择框的值 方式二:jQuery直接取值 var dep = xmSelect.get('#dep', true);dep:dep.getValue('valueStr')

                    1. <legend id='5bacF'><style id='5bacF'><dir id='5bacF'><q id='5bacF'></q></dir></style></legend>

                          <bdo id='5bacF'></bdo><ul id='5bacF'></ul>

                          <small id='5bacF'></small><noframes id='5bacF'>

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

                            <tbody id='5bacF'></tbody>
                        • <tfoot id='5bacF'></tfoot>