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

{
                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);
                                }
                            }
                        });
                }
            },

posted on 2019-02-14 09:27  城市小农民  阅读(129)  评论(0编辑  收藏  举报

导航