Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mvc #16

Open
topcss opened this issue Mar 22, 2019 · 0 comments
Open

Mvc #16

topcss opened this issue Mar 22, 2019 · 0 comments
Labels

Comments

@topcss
Copy link
Owner

topcss commented Mar 22, 2019

不验证某个字段
ModelState.Remove("TID");

多选下拉

PageInfo.Bundles.AddJs("~/Common/param?groups=BBDCLX");

PageInfo.Bundles.AddCss("~/assets/css/select2.min.css");
PageInfo.Bundles.AddJs("~/assets/js/select2.min.js");


@section ScriptLib {
    @* 本节可选,用于添加自己编写的js代码 *@
    <style>
        .clearPadding {
            padding: 0 !important;
        }
    </style>
    <script>

        // 获取数据字典为JSON数据
        function getJsonByDict(dictName) {
            var ret = [];
            var str = DcqParamGroup[dictName];
            if (str) {
                var list = str.split(';');
                for (var i = 0; i < list.length; i++) {
                    var kv = list[i].split(':');
                    ret.push({ id: kv[0], text: kv[1] });
                }
            }
            return ret;
        }

        $(function () {
            $("#EXPORTTYPES").select2({
                language: "zh-CN",
                placeholder: '请选择',
                multiple: true,
                allowClear: true,
                data: getJsonByDict("BBDCLX")
            });
        })
    </script>
}

<div class="form-group  col-md-6">
    @Html.LabelFor(model => model.EXPORTTYPES, htmlAttributes: new { @class = "col-xs-12 col-sm-3 col-md-4 control-label no-padding-right" })
    <div class="col-xs-12 col-sm-9 col-md-8">
        @Html.EditorFor(model => model.EXPORTTYPES, new { htmlAttributes = new { @class = "clearPadding col-xs-12" } })
        @Html.ValidationMessageFor(model => model.EXPORTTYPES, "", new { @class = "text-danger" })
    </div>
</div>
@topcss topcss added the 🔪C# label Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant