kendo Vue filiter功能

本文介绍如何在Kendo UI Grid中配置数据源和过滤器,使用'contains'操作符进行产品名称的模糊搜索,并通过定义过滤器逻辑实现特定订单ID的数据筛选。
<!-- 直接输入查找,无漏斗,contains -->
        <kendo-grid-column :field="'ProductName'"
                           :width="180"
                           :filterable-cell-show-operators="false"
                           :filterable-cell-operator="'contains'"
                           ></kendo-grid-column>
    <kendo-datasource ref="datasource1"
                      :type="'odata'"
                      :transport-read-url="'https://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders'"
                      :page-size='20'
                      :filter="filter"//定义过滤器
                      :server-paging="true"
                      :server-filtering="true"
                      :schema-model-fields="dsSchemaFields">
    </kendo-datasource>
data () {
        return {
           filter: {//定义的过滤器
            logic: "and",
            filters: [
                { field: "OrderID", operator: "eq", value: 10248 }
            ]
        },
            dsSchemaFields: {
                OrderID: { type: "number" },
                Freight: { type: "string" },
                ShipName: { type: "string" },
                OrderDate: { type: "date" },//有日期数据类型需要生命type:"date"
                ShipCity: { type: "string" }
            }
          
        }
    },

用methods和钩子函数触发更新

methods: {

        logData: function() {
          
            var ds = this.$refs.datasource1.kendoWidget();
            ds.fetch();
        }
    },
    mounted:function(){
      this.logData();
    }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值