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

      2. <small id='qOJG9'></small><noframes id='qOJG9'>

          <bdo id='qOJG9'></bdo><ul id='qOJG9'></ul>
        <tfoot id='qOJG9'></tfoot>
      3. <legend id='qOJG9'><style id='qOJG9'><dir id='qOJG9'><q id='qOJG9'></q></dir></style></legend>

        layui下拉多选框xm-select.js插件的使用

        时间:2024-12-23

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

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

            • <legend id='kjMy3'><style id='kjMy3'><dir id='kjMy3'><q id='kjMy3'></q></dir></style></legend>
              • <bdo id='kjMy3'></bdo><ul id='kjMy3'></ul>

                    <tbody id='kjMy3'></tbody>
                  <tfoot id='kjMy3'></tfoot>
                1. 创建容器

                  xm-select-demo,选择容器
                  隐藏赋值取值表单;
                  <div id="selected_box" class="layui-input-inline xm-select-demo" style="width:150px;">
                  <input type="hidden" id="poi_category_id"></div>

                  异步获取代码

                  //获取分类;
                          $.ajax({
                              type: 'get',
                              url: "./api/api.php?act=getCategory&token=3cab7ce4142608c0f40c785b5ab5ca24",
                              data: {},
                              dataType: "json",
                              success: function (res) {
                                  var data = [];
                                  for (var i = 0; i < res.data.length; i++) {
                                      data.push({name: res.data[i].category_name, value: res.data[i].category_id});
                                  }
                          xmSelect.render({
                                      el: '#selected_box',
                                      theme: {
                                          color: 'rgba(255, 87, 34,0.8)',
                                      },
                                      language: 'zn',
                                      filterable:true,
                                      data: data,
                                      on: function(data){
                                          var selectArr = data.arr;
                                          var seachArr = [];
                                          for (var j = 0; j < selectArr.length; j++) {
                                              seachArr.push(selectArr[j].value)
                                          }
                                          $("#poi_category_id").val(seachArr.toString());
                                      }
                                  })
                              },
                              error: function (err) {
                                  console.log(err)
                              }
                          });

                  赋值表单

                  $("#poi_category_id").val(seachArr.toString());
                   
                  上一篇:mui消息框alert,confirm,prompt,toast实例 下一篇:没有了

                  相关文章

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

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

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

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