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

Not able to remove duplicate from the filter option

5 Answers 1050 Views
Grid
This is a migrated thread and some comments may be shown as answers.
neetu
Top achievements
Rank 1
neetu asked on 28 Feb 2017, 03:23 PM

Hi ,

  On a KENDO Grid , if i set " multi: true, search: true, dataSource: ds" for the checkboxes option on filter , it shows the duplicate records of the datasource on filter checkboxes. Below please see the code for reference.

 

 var grid = $("#grid2").kendoGrid({

                    dataSource: ds,

                    columnMenu: {
                        columns: false
                    },
                    columns: [
                         { title: "ID", field: "DocumentID", width: 100 },
                         { title: "Region", field: "Region", width: 100, filterable: {  multi: true, dataSource: [{ Region: "HQ" }, { Region: "EAPRO" }] }, lockable: true },
                         { title: "Office", field: "Office", width: 100  , filterable: { multi: true,  dataSource: [{ Office: "" }] }, lockable: true},
                         { title: "YOC", field: "YearofCompletion", width: 100 },
                         { title: "Title", field: "Title", width: 100 },
                         { title: "Status", field: "Status", width: 100, filterable: { multi: true, dataSource: [{ Status: "On-track" }] }, lockable: true },
                         { title: "Sector", field: "SectorMirror", width: 100, filterable: { multi: true, search: true, dataSource: ds }, lockable: true },
                         { title: "Type", field: "Type", width: 100, filterable: { multi: true,  search: true, dataSource: ds }, lockable: true },
                         { title: "Phase", field: "Phase", width: 100, filterable: { multi: true, dataSource: [{ Phase: "Planning" }] }, lockable: true },
                         { title: "Language", field: "Language", width: 100, filterable: { multi: true, dataSource: [{ Language: "English" }] }, lockable: true },
                         { title: "Rating", field: "Rating", width: 100, filterable: { multi: true, search: true, dataSource: ds }, lockable: true }
                    ],
                    filterable: { mode: "menu" },
                   // mode: "menu",

 

Thanks,

neetu 

5 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 02 Mar 2017, 11:05 AM
Hello Neetu,

If you are going to use the same dataSource from the Grid you do not need to explicitly set it in the column. However, if you need to use separate dataSource for the filter you should return only unique values as demonstrated for the second Grid in the following online demo:

Best Regards,
Konstantin Dikov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Rajesh
Top achievements
Rank 1
answered on 05 Oct 2018, 09:09 AM

Same issue to me.

i pass my data source to my columns then i'm getting duplicates 

if i wont pass data source my filter is not working like excel filter 

my requirement is :-- in grid widget 

1).i want apply excel find of filers

 i got these example url  https://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/filtering/grid-with-excel-like-filter

2).filter options should be sort 

 i got these example url   http://dojo.telerik.com/AyEca/2  

3).filter options should be duplicates 

i got these example url  https://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/filtering/checkbox-filter-menu

 

how do i add these 3 scenarios on my grid filter

can any once guide me 

0
Konstantin Dikov
Telerik team
answered on 09 Oct 2018, 07:07 AM
Hi Fezile,

Could you please take a look at the following HowTo example and see if the result meets your requirements:
The following example also shows sorted multi checkbox filter, so could you please elaborate what from your requirements is not fulfilled with it:
Looking forward to your reply.


Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Rajesh
Top achievements
Rank 1
answered on 12 Oct 2018, 10:52 AM

HI Konstantin,

Thanks to reply me.

i don't know why same example urls are giving.i got those example urls before by using those example urls i couldn't achieve my requirement.

on jquery grid widget issue 

My requirement is:--

i'm using column menu int event not filter menu int 

every one giving me filter menu int examples .try to use column menu int event 

1).grid filter options should be sort 

2).no duplicates on filter options

3).when we search record on filter search box then select all options is disappearing .i want implement always visible select all. options. 

4)if i apply filter then those values should be appear on filter options not total page size values.

5).filter options values should be come current page size values,not total page size values. but i'm getting  total page size values

 

please create a example dojo url  then apply these requirements then forward me.

please dont suggest me examples urls it couldn't help me.

Thanks In Advance.

 

 

 

0
Konstantin Dikov
Telerik team
answered on 16 Oct 2018, 07:31 AM
Hello Fezile,

Please take a look at the following dojo example with enabled columnMenu:
The logic for sorting the UnitsInStock filter checkboxes is moved to the columnMenuInit event, but if you want to update them each time the column menu is opened, you could use the columnMenuOpen event instead. Additionally, for unique values you will have to manually remove the duplicates returned by the "view" or "data" method, before passing the data to the filter.


Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
neetu
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Rajesh
Top achievements
Rank 1
Share this question
or