ITPub博客

首页 > IT职业 > IT职场 > 杂记

杂记

IT职场 作者:sinlong 时间:2021-09-09 09:20:18 0 删除 编辑

只能输入纯数字和“-”,且首尾必须是数字。

^(([0-9])+(-)+([0-9])+)+$

可纯数字,可纯英文,可数字和英文混合。

^[0-9a-zA_Z]+$

防止DataTable 刷新时请求两次后台数据:

DataTable 共通部分封装

angular.module('app.datas')
    .factory('MyDTOptionsBuilder', function (DTOptionsBuilder, $translate) {
        return {
            fromSource: function (source) {
                return DTOptionsBuilder
                    .fromSource(source)
                    .withOption('autoWidth', true)
                    .withOption('scrollCollapse', true)
                    .withOption('sAjaxDataProp', 'data')
                    .withOption('aLengthMenu', [10, 25, 50])
                    .withOption('serverSide', true)
                    .withPaginationType('full_numbers')
                    .withLanguage({
                        'sEmptyTable': $translate.instant('empty'),
                        'sInfoEmpty': '',
                        'sLoadingRecords': $translate.instant('Load'),
                        'lengthMenu': $translate.instant('show') + ' _MENU_ ' + $translate.instant('entries'),
                        'info': '_START_ - _END_ ' + $translate.instant('of') + '  _TOTAL_ ' + $translate.instant('items'),
                        'oPaginate': {
                            'sNext': '',
                            'sPrevious': ''
                        }
                    });
            }
        };
    });

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/3156/viewspace-2802365/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: ASP.NET Page 那点事
请登录后发表评论 登录
全部评论

注册时间:2019-08-30

  • 博文量
    0
  • 访问量
    685