简体   繁体   English

问:如何使用复选框过滤剑道网格数据?

[英]Q:How to filter kendo-grid data by using checkbox?

Is there a way to filter kendo grid data by using checkbox? 有没有一种方法可以通过使用复选框来过滤剑道网格数据? Sample grid-data 样本网格数据

 var defaultData = [{ clientName: "Jupiter-RTU-0B40", clientTypeID: 1, clientType: "PrimaryProbe", SystemTypeID: 5, SystemTypeName: "TEMS Automatic", lastUpdate: "28d", location: "3.08191833333333,101.58238", status: "InProcess", groups: [1, 2] }, { clientName: "RTU0010F3360B40", clientTypeID: 2, clientType: "Probe", SystemTypeID: 5, SystemTypeName: "TEMS Automatic", lastUpdate: "28d", location: "3.08191833333333,101.58238", status: "Pending", groups: [1, 2] }, { clientName: "MPC00200C6C2ACE", clientTypeID: 1, clientType: "PrimaryProbe", SystemTypeID: 5, SystemTypeName: "TEMS Automatic", lastUpdate: "82d", location: "63.7443,19.9584", status: "InProcess", groups: [1, 2] }, { clientName: "RTU0010F33FDBD8", clientTypeID: 1, clientType: "PrimaryProbe", SystemTypeID: 5, SystemTypeName: "TEMS Automatic", lastUpdate: "0d", location: "3.08191833333333,101.58238", status: "InProcess", groups: [1, 2] }, { clientName: "RTU0010F33FDBD8", clientTypeID: 2, clientType: "Probe", SystemTypeID: 6, SystemTypeName: "TEMS Automatic", lastUpdate: "0d", location: "3.08191833333333,101.58238", status: "Pending", groups: [1, 2] }] 

For example,I have a list of check box where it allow user to check/uncheck. 例如,我有一个复选框列表,它允许用户选中/取消选中。 An example like lastUpdate is uncheck then the grid will be showing all the data accordingly except lastUpdate. 取消选中lastUpdate之类的示例,则网格将相应地显示除lastUpdate外的所有数据。

For getting a boolean filter you have to define the datasource model. 为了获得布尔过滤器,您必须定义数据源模型。 You can set there your field type to boolean, so kendo will display a boolean filter. 您可以在此处将字段类型设置为布尔值,因此kendo将显示布尔值过滤器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM