This is a migrated thread and some comments may be shown as answers.

Kendo UI Grid - Custom filter with multi checkbox on boolean field

2 Answers 536 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Prakash
Top achievements
Rank 1
Prakash asked on 14 Jan 2016, 05:29 AM
I have two boolean columns named "IsActive" and "IsDeleted" in the database table. The column "IsActive" indicates whether the user is Active or Deactive, and the column "IsDeleted" for soft deletion. Now I want to have a single column called "Status" with filter options as multiple checkbox as Active, Deactive and Delete. How can I implement this filter column in the grid? I have attached the screenshot for your reference.

2 Answers, 1 is accepted

Sort by
0
Accepted
Boyan Dimitrov
Telerik team
answered on 15 Jan 2016, 04:05 PM

Hello Prakash,

 

Since the status field does not exists in the data table, an additional field should be added to the response coming from the server. The best option for this is to use the schema.parse that is executed before the server response is used. It could be used to preprocess the data before passed to the Kendo UI DataSource. 

 

Basically you can add an additional field "status" to the response and bind a column of the grid to that field. The field will have three possible values : "activated", "deactivated" and "deleted". 

 

In order to show the check boxes in the filter menu you can enable the multi filter check box for the "status" column as shown in the Grid / Filter Multi Checkboxes demo. 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Prakash
Top achievements
Rank 1
answered on 15 Jan 2016, 04:17 PM
That's great. Thanks for the idea.
Tags
Grid
Asked by
Prakash
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Prakash
Top achievements
Rank 1
Share this question
or