kendo ui 使用问题记录

filed中使用日期格式化无效

需要指定该字段的类型,在DataSource 在进行数据类型指定

schema: {
                data: 'rows',
                total: 'total',
                model: {
                    id: "taskPaymentId",
                    fields: {
                        docDate:{type:"date"}
                    }
                }
            }

在column的字段中再使用format: “{0: yyyy-MM-dd}”

在Grid中使用了过滤,想把过滤条件传到服务器端

在dataSource 中添加参数:

serverFiltering: true

在transport 的parameterMap 中接收过滤条件


transport: {
read: {
url: BaseUrl + "query",
type: "POST",
dataType: "json"
},
parameterMap : function(options, type) {
if (type === "read") {
//判断是否有过滤条件
if(options.filter){
for (var i = 0; i < options.filter.filters.length; i++) {
if (options.filter.filters[i].field == 'docDate') {
var date = new Date(options.filter.filters[i].value);
var p = kendo.toString(date, "yyyy-MM-dd HH:mm:ss");
options.filter.filters[i].value = p;
}
viewModel.model.set(options.filter.filters[i].field,options.filter.filters[i].value);
}
}
datas = viewModel.model.toJSON();
return datas;
}
}
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值