首页 > 其他 > 详细

Grid列开始日期、结束日期限制大小

时间:2019-02-14 10:16:47      阅读:233      评论:0      收藏:0      [点我收藏+]

{
                field: "startDate",
                title: ‘开始时间‘,
                headerAttributes: {
                    "class": "table-header-cell",
                    style: "text-align: center"
                },
                attributes:{style: "white-space:nowrap;text-overflow:ellipsis;"},
                width: 120,
                format: "{0:yyyy-MM-dd}",
                editor: function(container, options) {
                    var end = options.model.endDate;
                    var d;
                    if(end){
                        d=end;
                    }
                    $(‘<input name="‘ + options.field + ‘"/>‘)
                        .appendTo(container)
                        .kendoDatePicker({
                            format:"yyyy-MM-dd",
                            max:d,
                            change:function(){
                                if(this.value()!=){
                                    d = this.value();
                                }else{
                                    d= new Date(1900, 0, 1, 22, 0, 0);
                                }
                            }
                        });
                }
            },
                    {
                field: "endDate",
                title: ‘结束时间‘,
                headerAttributes: {
                    "class": "table-header-cell",
                    style: "text-align: center"
                },
                attributes:{style: "white-space:nowrap;text-overflow:ellipsis;"},
                width: 120,
                format: "{0:yyyy-MM-dd}",
                editor: function(container, options) {
                    var start = options.model.startDate;
                    var d;
                    if(start){
                        d=start;
                    }
                    $(‘<input name="‘ + options.field + ‘"/>‘)
                        .appendTo(container)
                        .kendoDatePicker({
                            format:"yyyy-MM-dd",
                            min:d,
                            change:function(){
                                if(this.value()!=){
                                    d = this.value();
                                }else{
                                    d= new Date(2099, 0, 1, 22, 0, 0);
                                }
                            }
                        });
                }
            },

Grid列开始日期、结束日期限制大小

原文:https://www.cnblogs.com/chengshixiaonongming/p/10372815.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!