From b3e40160b2cc284d89d203750043b33d29dada61 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Fri, 18 Dec 2020 06:38:07 +0800 Subject: [PATCH] update Former-commit-id: 15294e7d200e499d2eac69d5bb04ac834340c30b Former-commit-id: 4300c89e5f4376d9409d26b7dad58928b5d79b65 --- .../Shared/EditorTemplates/SelectList.cshtml | 2 +- projects/IoT.Shared/wwwroot/css/site.css | 3 ++ projects/IoT.Shared/wwwroot/js/site.js | 36 +++++++++---------- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/projects/Infrastructure/Views/Shared/EditorTemplates/SelectList.cshtml b/projects/Infrastructure/Views/Shared/EditorTemplates/SelectList.cshtml index ed4aa104..a71db624 100644 --- a/projects/Infrastructure/Views/Shared/EditorTemplates/SelectList.cshtml +++ b/projects/Infrastructure/Views/Shared/EditorTemplates/SelectList.cshtml @@ -1,6 +1,6 @@ @{ var list = new SelectList(new List()); - var htmlClass = "form-control search"; + var htmlClass = "form-control select2bs4"; if (!string.IsNullOrEmpty(ViewData.ModelMetadata.TemplateHint)) { htmlClass += " " + ViewData.ModelMetadata.TemplateHint; diff --git a/projects/IoT.Shared/wwwroot/css/site.css b/projects/IoT.Shared/wwwroot/css/site.css index b5c70a0d..21064b7b 100644 --- a/projects/IoT.Shared/wwwroot/css/site.css +++ b/projects/IoT.Shared/wwwroot/css/site.css @@ -81,4 +81,7 @@ h1 { } .breadcrumb.float-sm-right{ background-color:transparent; +} +.select2-container--bootstrap4 .select2-results > .select2-results__options { + max-height: 400px; } \ No newline at end of file diff --git a/projects/IoT.Shared/wwwroot/js/site.js b/projects/IoT.Shared/wwwroot/js/site.js index 356df3ae..bcd4b140 100644 --- a/projects/IoT.Shared/wwwroot/js/site.js +++ b/projects/IoT.Shared/wwwroot/js/site.js @@ -159,24 +159,24 @@ function InitControls() { theme: "bootstrap4", language: "zh-CN", placeholder: '请选择', - allowClear: true, - minimumInputLength: 2, - ajax: { - url: $(this).attr('data-ajax-url'), - data: function (params) { - var query = { - search: params.term, - type: 'public' - } - return query; - }, - dataType: 'json', - processResults: function (data) { - return { - results: Enumerable.from(data).select(function (o) { return { id: o.value, text: o.text }; }).toArray() - }; - } - } + //allowClear: true, + //minimumInputLength: 2, + //ajax: { + // url: $(this).attr('data-ajax-url'), + // data: function (params) { + // var query = { + // search: params.term, + // type: 'public' + // } + // return query; + // }, + // dataType: 'json', + // processResults: function (data) { + // return { + // results: Enumerable.from(data).select(function (o) { return { id: o.value, text: o.text }; }).toArray() + // }; + // } + //} }); // $('input.cron').each(function () {